Shaka Player Embedded
Classes | Typedefs | Functions | Variables
shaka::impl Namespace Reference

Classes

struct  _callable_identifier
 
struct  _generic_converter_identifier
 
struct  _number_identifier
 
struct  _SelectSpecialTypes
 
struct  _SelectSpecialTypes< T, util::enable_if_t< std::is_base_of< GenericConverter, T >::value > >
 
struct  _SelectSpecialTypes< T, util::enable_if_t< util::is_callable< T >::value > >
 
struct  _SelectSpecialTypes< T, util::enable_if_t< util::is_number< T >::value > >
 
struct  CallAndSetReturn
 
struct  CallAndSetReturn< void >
 
struct  CallHelper
 
struct  CallHelper< ArgCount, ArgCount >
 
struct  ConvertHelper
 
struct  ConvertHelper< bool, void >
 
struct  ConvertHelper< Func, _callable_identifier >
 
struct  ConvertHelper< Handle< JsObject >, void >
 
struct  ConvertHelper< Number, _number_identifier >
 
struct  ConvertHelper< Player::LogLevel >
 
struct  ConvertHelper< RefPtr< T > >
 
struct  ConvertHelper< ReturnVal< T >, void >
 
struct  ConvertHelper< shaka::BufferedInfo, void >
 
struct  ConvertHelper< shaka::BufferedRange, void >
 
struct  ConvertHelper< shaka::DrmInfo, void >
 
struct  ConvertHelper< shaka::InitDataOverride, void >
 
struct  ConvertHelper< shaka::LanguageRole, void >
 
struct  ConvertHelper< shaka::optional< T >, void >
 
struct  ConvertHelper< shaka::StateChange, void >
 
struct  ConvertHelper< shaka::Stats, void >
 
struct  ConvertHelper< shaka::StoredContent, void >
 
struct  ConvertHelper< shaka::Track, void >
 
struct  ConvertHelper< shaka::TrackChoice, void >
 
struct  ConvertHelper< shaka::variant< Types... > >
 
struct  ConvertHelper< std::string, void >
 
struct  ConvertHelper< std::unordered_map< Key, Value >, void >
 
struct  ConvertHelper< std::vector< T >, void >
 
struct  ConvertHelper< T *, void >
 
struct  ConvertHelper< T, _generic_converter_identifier >
 
class  EnumConverter
 
class  FieldConverter
 
class  FieldConverterBase
 
struct  FutureResolver
 
struct  FutureResolver< void >
 
struct  get_construct_index
 
struct  get_create_type
 
struct  get_create_type< This, decltype(void(&This::Create))>
 
struct  get_max_size
 
struct  get_max_size< T, Rest... >
 
struct  get_max_size<>
 
struct  get_type_at
 
struct  get_type_at< 0, T, Choices... >
 
struct  get_type_at< I, T, Choices... >
 
struct  get_type_index
 
struct  get_type_index< T, A, Choices... >
 
struct  get_type_index< T, T, Choices... >
 
struct  HandleSetReturn
 
struct  HandleSetReturn< ExceptionOr< T > >
 
struct  HandleSetReturn< ExceptionOr< void > >
 
class  IndexerHandler
 
class  IndexerHandlerImpl
 
struct  InternalCallbackData
 
struct  InternalCallbackDataBase
 
struct  is_variant
 
struct  is_variant< variant< Choices... > >
 
class  JsCallback
 
class  JsConstructor
 
struct  JsConstructorCreateOrThrow
 
struct  JsConstructorCreateOrThrow< This, This *(*)(Args...)>
 
struct  JsConstructorCreateOrThrow< This, void >
 
struct  NumberEnumConverter
 
class  PendingTask
 
class  PendingTaskBase
 
class  StringEnumConverter
 
struct  ThrowError
 
class  union_
 
class  union_< T >
 

Typedefs

template<size_t I, typename... Choices>
using get_type_at_t = typename get_type_at< I, Choices... >::type
 
template<size_t I, typename... Choices>
using get_const_reference_at_t = typename std::add_lvalue_reference< typename std::add_const< typename get_type_at< I, Choices... >::type >::type >::type
 
template<typename Func >
using RetOf = typename std::result_of< Func()>::type
 
template<typename T >
using RawType = typename std::remove_cv< typename std::remove_reference< T >::type >::type
 

Functions

bool ConstructWrapperObject (const CallbackArguments &arguments, BackingObject *that)
 
template<typename T , typename Arg >
ReturnVal< JsValue > CreateInternalData (T **extra_data, Arg &&arg)
 
template<typename Func >
ReturnVal< JsFunction > CreateJsFunctionFromCallback (const std::string &target, const std::string &name, Func &&callback, bool is_member_func)
 

Variables

constexpr const char * kHiddenPropertyName = "$__shaka_extra_data"
 

Typedef Documentation

§ get_const_reference_at_t

template<size_t I, typename... Choices>
using shaka::impl::get_const_reference_at_t = typedef typename std::add_lvalue_reference<typename std::add_const< typename get_type_at<I, Choices...>::type>::type>::type

Definition at line 74 of file variant.h.

§ get_type_at_t

template<size_t I, typename... Choices>
using shaka::impl::get_type_at_t = typedef typename get_type_at<I, Choices...>::type

Definition at line 69 of file variant.h.

§ RawType

template<typename T >
using shaka::impl::RawType = typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type

Careful, thar be magic here. Only read if you are familiar with template metaprogramming.

This file defines several functions that are used to convert a C++ function to a V8 function. A V8 function accepts a single argument that defines the array of arguments, some internal state, and the return value. This is not convenient with C++ code that accepts positional arguments and returns the value.

First, this checks each argument that is passed in. It tries to convert the argument to the expected type, throwing a JavaScript exception if it cannot do so. Then it calls the C++ function. Finally, if needed, converts the return value and passes back to JavaScript.

These methods all return a boolean. They should return |true| when JavaScript returns normally, or |false| if an exception is thrown.

Definition at line 70 of file register_member.h.

§ RetOf

template<typename Func >
using shaka::impl::RetOf = typedef typename std::result_of<Func()>::type

Definition at line 47 of file task_runner.h.

Function Documentation

§ ConstructWrapperObject()

bool shaka::impl::ConstructWrapperObject ( const CallbackArguments &  arguments,
BackingObject that 
)

This is called when defining a JavaScript constructor. This sets up the resulting JavaScript object and links it to the given backing object.

In V8, the JavaScript object is already created for us (stored in |arguments.This()|). All we need to do is connect it to the backing object by setting its internal fields.

In JSC, this creates a new JavaScript object using |This| to get the correct type. This method then sets the return value of the JavaScript function so the object is passed to JavaScript.

Parameters
argumentsThe arguments (including |this| and the return value) to the JavaScript function.
thatThe backing object to wrap.

Definition at line 23 of file register_member.cc.

§ CreateInternalData()

template<typename T , typename Arg >
ReturnVal<JsValue> shaka::impl::CreateInternalData ( T **  extra_data,
Arg &&  arg 
)

Creates extra data of the given type that will be passed to the callbacks when it is called. This allows us to pass internal data to specific function objects.

Definition at line 351 of file register_member.h.

§ CreateJsFunctionFromCallback()

template<typename Func >
ReturnVal<JsFunction> shaka::impl::CreateJsFunctionFromCallback ( const std::string &  target,
const std::string &  name,
Func &&  callback,
bool  is_member_func 
)

Definition at line 557 of file register_member.h.

Variable Documentation

§ kHiddenPropertyName

constexpr const char* shaka::impl::kHiddenPropertyName = "$__shaka_extra_data"

Definition at line 319 of file register_member.h.