Shaka Player Embedded
Main Page
Exported Types
+
Tutorials
Basic Tutorial
Network Filters
Internal Docs
+
Internal Class List
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Typedefs
a
b
d
e
f
h
i
l
m
r
s
t
v
Enumerations
+
Enumerator
a
b
c
d
e
k
n
p
t
v
+
Properties
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
+
Related Functions
:
a
c
d
g
j
m
o
p
r
s
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
shaka
src
js
idb
request.h
Go to the documentation of this file.
1
// Copyright 2016 Google LLC
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef SHAKA_EMBEDDED_JS_IDB_REQUEST_H_
16
#define SHAKA_EMBEDDED_JS_IDB_REQUEST_H_
17
18
#include "
shaka/optional.h
"
19
#include "
shaka/variant.h
"
20
#include "
src/core/member.h
"
21
#include "
src/core/ref_ptr.h
"
22
#include "
src/js/events/event_target.h
"
23
#include "
src/js/idb/sqlite.h
"
24
#include "
src/js/js_error.h
"
25
#include "
src/mapping/any.h
"
26
#include "
src/mapping/backing_object_factory.h
"
27
#include "
src/mapping/exception_or.h
"
28
29
namespace
shaka
{
30
namespace
js {
31
32
namespace
dom {
33
class
DOMException;
34
}
// namespace dom
35
36
namespace
idb {
37
38
class
IDBCursor;
39
class
IDBObjectStore;
40
class
IDBTransaction;
41
42
enum class
IDBRequestReadyState
{
43
PENDING
,
44
DONE
,
45
};
46
47
class
IDBRequest
:
public
events::EventTarget
{
48
DECLARE_TYPE_INFO
(
IDBRequest
);
49
50
public
:
51
IDBRequest
(
52
optional
<
variant
<
Member<IDBObjectStore>
,
Member<IDBCursor>
>>
source
,
53
RefPtr<IDBTransaction>
transaction);
54
55
void
Trace(
memory::HeapTracer
* tracer)
const override
;
56
61
virtual
void
PerformOperation(
SqliteTransaction
* transaction) = 0;
62
67
void
OnAbort();
68
69
ExceptionOr<Any>
Result()
const
;
70
ExceptionOr<Any>
Error
()
const
;
71
72
optional<variant<Member<IDBObjectStore>
,
Member<IDBCursor>
>>
source
;
73
Member<IDBTransaction>
transaction
;
74
IDBRequestReadyState
ready_state = IDBRequestReadyState::PENDING;
75
76
Listener
on_success
;
77
Listener
on_error
;
78
79
protected
:
84
void
CompleteSuccess(
Any
result);
85
90
void
CompleteError(
JsError
error);
91
void
CompleteError(
DatabaseStatus
status);
92
93
Any
result_
;
94
Any
error_
;
95
};
96
97
class
IDBRequestFactory
98
:
public
BackingObjectFactory
<IDBRequest, events::EventTarget> {
99
public
:
100
IDBRequestFactory
();
101
};
102
103
}
// namespace idb
104
}
// namespace js
105
}
// namespace shaka
106
107
DEFINE_ENUM_MAPPING
(
shaka::js::idb
,
IDBRequestReadyState
) {
108
AddMapping(Enum::PENDING,
"pending"
);
109
AddMapping(Enum::DONE,
"done"
);
110
}
111
112
#endif // SHAKA_EMBEDDED_JS_IDB_REQUEST_H_
shaka::ExceptionOr
Definition:
exception_or.h:36
DEFINE_ENUM_MAPPING
DEFINE_ENUM_MAPPING(shaka::js::idb, IDBRequestReadyState)
Definition:
request.h:107
shaka::js::idb::IDBRequestReadyState::DONE
shaka::js::idb::IDBRequest::on_success
Listener on_success
Definition:
request.h:76
shaka::Any
Definition:
any.h:31
optional.h
shaka::js::idb::IDBRequestFactory
Definition:
request.h:97
shaka::Member
Definition:
member.h:40
shaka::js::idb::IDBRequest::on_error
Listener on_error
Definition:
request.h:77
shaka::js::idb::IDBRequest
Definition:
request.h:47
shaka::js::idb
Definition:
cursor.cc:26
shaka::js::idb::IDBRequest::source
optional< variant< Member< IDBObjectStore >, Member< IDBCursor > > > source
Definition:
request.h:72
shaka::optional
Definition:
optional.h:39
source
const char * source
Definition:
media_utils.cc:30
ref_ptr.h
shaka::BackingObjectFactory
Definition:
backing_object_factory.h:406
shaka
Definition:
async_results.h:25
exception_or.h
shaka::memory::HeapTracer
Definition:
heap_tracer.h:85
variant.h
any.h
shaka::js::idb::IDBRequest::result_
Any result_
Definition:
request.h:93
backing_object_factory.h
member.h
shaka::RefPtr
Definition:
ref_ptr.h:43
shaka::js::idb::IDBRequest::error_
Any error_
Definition:
request.h:94
shaka::js::JsError
Definition:
js_error.h:30
js_error.h
shaka::js::events::EventTarget
Definition:
event_target.h:40
event_target.h
shaka::js::idb::SqliteTransaction
Definition:
sqlite.h:54
shaka::variant
Definition:
variant.h:36
shaka::js::idb::IDBRequestReadyState
IDBRequestReadyState
Definition:
request.h:42
shaka::js::idb::IDBRequestReadyState::PENDING
shaka::js::idb::IDBRequest::transaction
Member< IDBTransaction > transaction
Definition:
request.h:73
DECLARE_TYPE_INFO
#define DECLARE_TYPE_INFO(type)
Definition:
backing_object.h:39
shaka::Error
Definition:
error.h:34
shaka::js::idb::DatabaseStatus
DatabaseStatus
Definition:
sqlite.h:31
sqlite.h
Generated by
1.8.13