Shaka Player Embedded
Classes | Typedefs | Enumerations | Functions
shaka::js::idb Namespace Reference

Classes

class  IDBCursor
 
class  IDBCursorFactory
 
class  IDBDatabase
 
class  IDBDatabaseFactory
 
class  IDBDeleteDBRequest
 
class  IDBDeleteRequest
 
class  IDBFactory
 
class  IDBFactoryFactory
 
class  IDBGetRequest
 
class  IDBIterateCursorRequest
 
class  IDBObjectStore
 
class  IDBObjectStoreFactory
 
struct  IDBObjectStoreParameters
 
class  IDBOpenDBRequest
 
class  IDBOpenDBRequestFactory
 
class  IDBRequest
 
class  IDBRequestFactory
 
class  IDBStoreRequest
 
class  IDBTransaction
 
class  IDBTransactionFactory
 
class  SqliteConnection
 
class  SqliteTransaction
 

Typedefs

using IdbKeyType = int64_t
 

Enumerations

enum  IDBCursorDirection { IDBCursorDirection::NEXT, IDBCursorDirection::NEXT_UNIQUE, IDBCursorDirection::PREV, IDBCursorDirection::PREV_UNIQUE }
 
enum  IDBRequestReadyState { IDBRequestReadyState::PENDING, IDBRequestReadyState::DONE }
 
enum  DatabaseStatus {
  DatabaseStatus::Success, DatabaseStatus::NotFound, DatabaseStatus::AlreadyExists, DatabaseStatus::Busy,
  DatabaseStatus::BadVersionNumber, DatabaseStatus::UnknownError
}
 
enum  IDBTransactionMode { IDBTransactionMode::READ_ONLY, IDBTransactionMode::READ_WRITE, IDBTransactionMode::VERSION_CHANGE }
 

Functions

 DEFINE_STRUCT_SPECIAL_METHODS_COPYABLE (IDBObjectStoreParameters)
 
ExceptionOr< void > StoreInProto (Any input, proto::Value *result)
 
Any LoadFromProto (const proto::Value &value)
 

Typedef Documentation

§ IdbKeyType

using shaka::js::idb::IdbKeyType = typedef int64_t

Definition at line 29 of file idb_utils.h.

Enumeration Type Documentation

§ DatabaseStatus

Enumerator
Success 
NotFound 

The database, object store, or item was not found.

AlreadyExists 

An item with the given key/name already exists.

Busy 

There is another transaction happening (maybe by another program).

BadVersionNumber 

There was an attempt to set a negative version number or change it to a lower value.

UnknownError 

Definition at line 31 of file sqlite.h.

§ IDBCursorDirection

Enumerator
NEXT 
NEXT_UNIQUE 
PREV 
PREV_UNIQUE 

Definition at line 35 of file cursor.h.

§ IDBRequestReadyState

Enumerator
PENDING 
DONE 

Definition at line 42 of file request.h.

§ IDBTransactionMode

Enumerator
READ_ONLY 
READ_WRITE 
VERSION_CHANGE 

Definition at line 44 of file transaction.h.

Function Documentation

§ DEFINE_STRUCT_SPECIAL_METHODS_COPYABLE()

shaka::js::idb::DEFINE_STRUCT_SPECIAL_METHODS_COPYABLE ( IDBObjectStoreParameters  )

§ LoadFromProto()

Any shaka::js::idb::LoadFromProto ( const proto::Value value)

Converts the given stored Item and converts it into a new JavaScript object.

Parameters
valueThe stored object to convert.
Returns
A new JavaScript value that is the equivalent to |value|.

Definition at line 238 of file idb_utils.cc.

§ StoreInProto()

ExceptionOr< void > shaka::js::idb::StoreInProto ( Any  input,
proto::Value result 
)

Converts the given JavaScript object into a stored item. This is an expensive operation that makes copies of the data. Therefore, this should only be done right before being stored.

This implements part of the structured clone algorithm to copy the data. This does not support Blob, FileList, ImageData, Map, or Set since we don't define any of those types, and neither the RegExp or Date types. This also does not support retaining object references or cycles.

This will throw a JsError on error.

See also
https://www.w3.org/TR/html5/infrastructure.html#structured-clone
Parameters
inputThe value to convert.
result[OUT] If this returns true, will contain the new converted item
Returns
The thrown exception, or nothing on success.

Definition at line 233 of file idb_utils.cc.