Shaka Player Embedded
Classes | Public Member Functions | Friends | List of all members
shaka::eme::EmePromise Class Referencefinal

#include <eme_promise.h>

Classes

class  Impl
 

Public Member Functions

 EmePromise ()
 
 EmePromise (const EmePromise &other)
 
 EmePromise (EmePromise &&other)
 
 ~EmePromise ()
 
EmePromiseoperator= (const EmePromise &other)
 
EmePromiseoperator= (EmePromise &&other)
 
bool valid () const
 
void Resolve ()
 
void ResolveWith (bool value)
 
void Reject (ExceptionType except_type, const std::string &message)
 

Friends

class ClearKeyImplementationTest
 
class js::eme::MediaKeys
 
class js::eme::MediaKeySession
 

Detailed Description

Defines a wrapper around a JavaScript Promise object.

EME APIs are always given valid Promise objects; but if you use the default constructor or use std::move(), it will create an invalid Promise object. You can't call any methods on an invalid object except for valid().

This type is not thread-safe.

Definition at line 47 of file eme_promise.h.

Constructor & Destructor Documentation

§ EmePromise() [1/3]

shaka::eme::EmePromise::EmePromise ( )

Creates an invalid Promise object. The members of this object can't be used unless a valid Promise is moved/copied into this.

Definition at line 119 of file eme_promise.cc.

§ EmePromise() [2/3]

shaka::eme::EmePromise::EmePromise ( const EmePromise other)
default

§ EmePromise() [3/3]

shaka::eme::EmePromise::EmePromise ( EmePromise &&  other)
default

§ ~EmePromise()

shaka::eme::EmePromise::~EmePromise ( )

Definition at line 125 of file eme_promise.cc.

Member Function Documentation

§ operator=() [1/2]

EmePromise & shaka::eme::EmePromise::operator= ( const EmePromise other)
default

§ operator=() [2/2]

EmePromise & shaka::eme::EmePromise::operator= ( EmePromise &&  other)
default

§ Reject()

void shaka::eme::EmePromise::Reject ( ExceptionType  except_type,
const std::string &  message 
)

Rejects the Promise with the given error. If the Promise has already been resolved/rejected, this call is ignored.

Definition at line 142 of file eme_promise.cc.

§ Resolve()

void shaka::eme::EmePromise::Resolve ( )

Resolves the Promise. If the Promise has already been resolved/rejected, this call is ignored.

Definition at line 134 of file eme_promise.cc.

§ ResolveWith()

void shaka::eme::EmePromise::ResolveWith ( bool  value)

Resolves the Promise with the given value. If the Promise has already been resolved/rejected, this call is ignored.

Definition at line 138 of file eme_promise.cc.

§ valid()

bool shaka::eme::EmePromise::valid ( ) const
Returns
Whether this object is valid and can be resolved/rejected.

Definition at line 130 of file eme_promise.cc.

Friends And Related Function Documentation

§ ClearKeyImplementationTest

friend class ClearKeyImplementationTest
friend

Definition at line 84 of file eme_promise.h.

§ js::eme::MediaKeys

friend class js::eme::MediaKeys
friend

Definition at line 87 of file eme_promise.h.

§ js::eme::MediaKeySession

friend class js::eme::MediaKeySession
friend

Definition at line 88 of file eme_promise.h.


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