Shaka Player Embedded
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
shaka::js::events::Event Class Reference

#include <event.h>

Inheritance diagram for shaka::js::events::Event:
shaka::BackingObject shaka::memory::Traceable shaka::js::events::IDBVersionChangeEvent shaka::js::events::MediaEncryptedEvent shaka::js::events::MediaKeyMessageEvent shaka::js::events::ProgressEvent

Public Types

enum  EventPhase { NONE = 0, CAPTURING_PHASE = 1, AT_TARGET = 2, BUBBLING_PHASE = 3 }
 

Public Member Functions

 Event (EventType type)
 
void Trace (memory::HeapTracer *tracer) const override
 
bool IsShortLived () const override
 
bool is_stopped () const
 
bool is_immediate_stopped () const
 
void PreventDefault ()
 
void StopImmediatePropagation ()
 
void StopPropagation ()
 
- Public Member Functions inherited from shaka::BackingObject
 BackingObject ()
 
void Trace (memory::HeapTracer *tracer) const override
 
bool IsRootedAlive () const override
 
std::string name () const
 
virtual BackingObjectFactoryBasefactory () const =0
 
bool DerivedFrom (const std::string &base)
 
ReturnVal< JsValue > JsThis () const
 
void SetJsThis (Handle< JsObject > this_)
 
- Public Member Functions inherited from shaka::memory::Traceable
virtual ~Traceable ()
 

Static Public Member Functions

static EventCreate (const std::string &type)
 
- Static Public Member Functions inherited from shaka::BackingObject
static void * operator new[] (size_t size)=delete
 
static void operator delete[] (void *)=delete
 

Public Attributes

const bool bubbles = false
 
const bool cancelable = false
 
const bool is_trusted = false
 
const std::string type
 
const double time_stamp
 
Member< EventTargetcurrent_target
 
Member< EventTargettarget
 
int event_phase = NONE
 
bool default_prevented = false
 

Protected Member Functions

 Event (const std::string &type)
 
- Protected Member Functions inherited from shaka::BackingObject
 ~BackingObject () override
 

Additional Inherited Members

- Static Public Attributes inherited from shaka::BackingObject
static constexpr const size_t kInternalFieldCount = 2
 
- Static Public Attributes inherited from shaka::memory::Traceable
static constexpr const uint64_t kShortLiveDurationMs = 5000
 

Detailed Description

Definition at line 31 of file event.h.

Member Enumeration Documentation

§ EventPhase

Enumerator
NONE 
CAPTURING_PHASE 
AT_TARGET 
BUBBLING_PHASE 

Definition at line 38 of file event.h.

Constructor & Destructor Documentation

§ Event() [1/2]

shaka::js::events::Event::Event ( const std::string &  type)
explicitprotected

Definition at line 28 of file event.cc.

§ Event() [2/2]

shaka::js::events::Event::Event ( EventType  type)
explicit

Definition at line 26 of file event.cc.

Member Function Documentation

§ Create()

static Event* shaka::js::events::Event::Create ( const std::string &  type)
inlinestatic

Definition at line 47 of file event.h.

§ is_immediate_stopped()

bool shaka::js::events::Event::is_immediate_stopped ( ) const
inline

Definition at line 57 of file event.h.

§ is_stopped()

bool shaka::js::events::Event::is_stopped ( ) const
inline

Definition at line 54 of file event.h.

§ IsShortLived()

bool shaka::js::events::Event::IsShortLived ( ) const
overridevirtual

Gets whether the object is considered short-lived. This means that once the C++ ref-count is zero, the object won't remain alive for long. It is important to only set this if the JavaScript object won't be used for long.

This exists for JSC which doesn't offer a way for us to track whether a JavaScript object is still alive. If the JavaScript object is used after the backing object is destroyed, then a JavaScript exception will be thrown.

Reimplemented from shaka::memory::Traceable.

Definition at line 43 of file event.cc.

§ PreventDefault()

void shaka::js::events::Event::PreventDefault ( )

Definition at line 47 of file event.cc.

§ StopImmediatePropagation()

void shaka::js::events::Event::StopImmediatePropagation ( )

Definition at line 52 of file event.cc.

§ StopPropagation()

void shaka::js::events::Event::StopPropagation ( )

Definition at line 57 of file event.cc.

§ Trace()

Doxygen_Skip void shaka::js::events::Event::Trace ( memory::HeapTracer tracer) const
overridevirtual

Called during a GC run. This should call HeapTracer::Trace on all Traceable members. Be sure to call the base method when overriding.

Implements shaka::memory::Traceable.

Reimplemented in shaka::js::events::MediaEncryptedEvent, and shaka::js::events::MediaKeyMessageEvent.

Definition at line 37 of file event.cc.

Member Data Documentation

§ bubbles

const bool shaka::js::events::Event::bubbles = false

Definition at line 67 of file event.h.

§ cancelable

const bool shaka::js::events::Event::cancelable = false

Definition at line 68 of file event.h.

§ current_target

Member<EventTarget> shaka::js::events::Event::current_target

Definition at line 72 of file event.h.

§ default_prevented

bool shaka::js::events::Event::default_prevented = false

Definition at line 75 of file event.h.

§ event_phase

int shaka::js::events::Event::event_phase = NONE

Definition at line 74 of file event.h.

§ is_trusted

const bool shaka::js::events::Event::is_trusted = false

Definition at line 69 of file event.h.

§ target

Member<EventTarget> shaka::js::events::Event::target

Definition at line 73 of file event.h.

§ time_stamp

const double shaka::js::events::Event::time_stamp

Definition at line 71 of file event.h.

§ type

const std::string shaka::js::events::Event::type

Definition at line 70 of file event.h.


The documentation for this class was generated from the following files: