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
mapping
backing_object.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_MAPPING_BACKING_OBJECT_H_
16
#define SHAKA_EMBEDDED_MAPPING_BACKING_OBJECT_H_
17
18
#include <glog/logging.h>
19
20
#include <string>
21
22
#include "
src/mapping/js_wrappers.h
"
23
#include "
src/mapping/weak_js_ptr.h
"
24
#include "
src/memory/heap_tracer.h
"
25
26
namespace
shaka
{
27
28
namespace
memory {
29
class
HeapTracer
;
30
class
ObjectTracker
;
31
}
// namespace memory
32
33
namespace
js {
34
class
Debug;
35
}
// namespace js
36
37
class
BackingObjectFactoryBase
;
38
39
#define DECLARE_TYPE_INFO(type) \
40
public: \
41
static std::string name() { \
42
return #type; \
43
} \
44
\
45
protected: \
46
~type() override; \
47
\
48
public: \
49
::shaka::BackingObjectFactoryBase* factory() const override
50
56
class
BackingObject
:
public
memory::Traceable
{
57
public
:
58
BackingObject
();
59
61
static
constexpr
const
size_t
kInternalFieldCount = 2;
62
63
// In WebKit, it says that MSVC requires delete[] for exported classes.
64
// https://goo.gl/eXrvjn
65
// Disable new[] and delete[] since we use 'delete' in the ObjectTracker to
66
// delete objects and that does not work with arrays.
67
static
void
*
operator
new
[](
size_t
size) =
delete
;
68
static
void
operator
delete
[](
void
*) =
delete
;
69
70
void
Trace(
memory::HeapTracer
* tracer)
const override
;
71
bool
IsRootedAlive()
const override
;
72
74
std::string
name
()
const
;
75
77
virtual
BackingObjectFactoryBase
* factory()
const
= 0;
78
80
bool
DerivedFrom(
const
std::string& base);
81
86
ReturnVal<JsValue> JsThis()
const
;
87
89
void
SetJsThis(Handle<JsObject> this_);
90
91
protected
:
92
friend
class
memory::ObjectTracker
;
93
~
BackingObject
()
override
;
94
95
private
:
96
WeakJsPtr<JsObject>
js_this_;
97
};
98
99
}
// namespace shaka
100
101
#endif // SHAKA_EMBEDDED_MAPPING_BACKING_OBJECT_H_
shaka::memory::ObjectTracker
Definition:
object_tracker.h:51
weak_js_ptr.h
shaka::WeakJsPtr< JsObject >
name
const char * name
Definition:
dom_exception.cc:35
shaka
Definition:
async_results.h:25
shaka::BackingObjectFactoryBase
Definition:
backing_object_factory.h:156
js_wrappers.h
shaka::memory::HeapTracer
Definition:
heap_tracer.h:85
heap_tracer.h
shaka::memory::Traceable
Definition:
heap_tracer.h:43
shaka::BackingObject
Definition:
backing_object.h:56
Generated by
1.8.13