FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ClearScriptForUnity3d/ClearScriptV8/V8ObjectHolderImpl.cpp at Unity3D · vovgou/ClearScriptForUnity3d · GitHub
vovgou
/
ClearScriptForUnity3d
Public
forked from
ClearFoundry/ClearScript
Notifications
You must be signed in to change notification settings
Fork
2
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ClearScriptForUnity3d
/
ClearScriptV8
/
V8ObjectHolderImpl.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
123 lines (90 loc) · 4.2 KB
Breadcrumbs
ClearScriptForUnity3d
/
ClearScriptV8
/
V8ObjectHolderImpl.cpp
Copy path
File metadata and controls
123 lines (90 loc) · 4.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//
Copyright (c) Microsoft Corporation. All rights reserved.
//
Licensed under the MIT license.
#
include
"
ClearScriptV8Native.h
"
//
-----------------------------------------------------------------------------
//
V8ObjectHolderImpl implementation
//
-----------------------------------------------------------------------------
V8ObjectHolderImpl::V8ObjectHolderImpl
(
const
SharedPtr<V8WeakContextBinding>& pBinding,
void
* pvObject):
m_spBinding(pBinding),
m_pvObject(pvObject)
{
}
//
-----------------------------------------------------------------------------
V8ObjectHolderImpl*
V8ObjectHolderImpl::Clone
()
const
{
return
new
V8ObjectHolderImpl
(m_spBinding, m_spBinding->
GetIsolateImpl
()->
AddRefV8Object
(m_pvObject));
}
//
-----------------------------------------------------------------------------
void
*
V8ObjectHolderImpl::GetObject
()
const
{
return
m_pvObject;
}
//
-----------------------------------------------------------------------------
V8Value
V8ObjectHolderImpl::GetProperty
(
const
StdString& name)
const
{
return
m_spBinding->
GetContextImpl
()->
GetV8ObjectProperty
(m_pvObject, name);
}
//
-----------------------------------------------------------------------------
void
V8ObjectHolderImpl::SetProperty
(
const
StdString& name,
const
V8Value& value)
const
{
m_spBinding->
GetContextImpl
()->
SetV8ObjectProperty
(m_pvObject, name, value);
}
//
-----------------------------------------------------------------------------
bool
V8ObjectHolderImpl::DeleteProperty
(
const
StdString& name)
const
{
return
m_spBinding->
GetContextImpl
()->
DeleteV8ObjectProperty
(m_pvObject, name);
}
//
-----------------------------------------------------------------------------
void
V8ObjectHolderImpl::GetPropertyNames
(std::vector<StdString>& names)
const
{
m_spBinding->
GetContextImpl
()->
GetV8ObjectPropertyNames
(m_pvObject, names);
}
//
-----------------------------------------------------------------------------
V8Value
V8ObjectHolderImpl::GetProperty
(
int
index)
const
{
return
m_spBinding->
GetContextImpl
()->
GetV8ObjectProperty
(m_pvObject, index);
}
//
-----------------------------------------------------------------------------
void
V8ObjectHolderImpl::SetProperty
(
int
index,
const
V8Value& value)
const
{
m_spBinding->
GetContextImpl
()->
SetV8ObjectProperty
(m_pvObject, index, value);
}
//
-----------------------------------------------------------------------------
bool
V8ObjectHolderImpl::DeleteProperty
(
int
index)
const
{
return
m_spBinding->
GetContextImpl
()->
DeleteV8ObjectProperty
(m_pvObject, index);
}
//
-----------------------------------------------------------------------------
void
V8ObjectHolderImpl::GetPropertyIndices
(std::vector<
int
>& indices)
const
{
m_spBinding->
GetContextImpl
()->
GetV8ObjectPropertyIndices
(m_pvObject, indices);
}
//
-----------------------------------------------------------------------------
V8Value
V8ObjectHolderImpl::Invoke
(
bool
asConstructor,
const
std::vector<V8Value>& args)
const
{
return
m_spBinding->
GetContextImpl
()->
InvokeV8Object
(m_pvObject, asConstructor, args);
}
//
-----------------------------------------------------------------------------
V8Value
V8ObjectHolderImpl::InvokeMethod
(
const
StdString& name,
const
std::vector<V8Value>& args)
const
{
return
m_spBinding->
GetContextImpl
()->
InvokeV8ObjectMethod
(m_pvObject, name, args);
}
//
-----------------------------------------------------------------------------
void
V8ObjectHolderImpl::GetArrayBufferOrViewInfo
(V8Value& arrayBuffer,
size_t
& offset,
size_t
& size,
size_t
& length)
const
{
m_spBinding->
GetContextImpl
()->
GetV8ObjectArrayBufferOrViewInfo
(m_pvObject, arrayBuffer, offset, size, length);
}
//
-----------------------------------------------------------------------------
void
V8ObjectHolderImpl::InvokeWithArrayBufferOrViewData
(V8ObjectHelpers::ArrayBufferOrViewDataCallback* pCallback,
void
* pvArg)
const
{
m_spBinding->
GetContextImpl
()->
InvokeWithV8ObjectArrayBufferOrViewData
(m_pvObject, pCallback, pvArg);
}
//
-----------------------------------------------------------------------------
V8ObjectHolderImpl::~V8ObjectHolderImpl
()
{
SharedPtr<V8IsolateImpl> spIsolateImpl;
if
(m_spBinding->
TryGetIsolateImpl
(spIsolateImpl))
{
spIsolateImpl->
ReleaseV8Object
(m_pvObject);
}
}
Back
|
FazBrowse Home
|
New Git URL