OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 #include "V8TestInterface3.h" | 8 #include "V8TestSpecialOperationsCustom.h" |
9 | 9 |
10 #include "RuntimeEnabledFeatures.h" | 10 #include "RuntimeEnabledFeatures.h" |
11 #include "V8Node.h" | 11 #include "V8Node.h" |
12 #include "bindings/v8/ExceptionState.h" | 12 #include "bindings/v8/ExceptionState.h" |
13 #include "bindings/v8/V8DOMConfiguration.h" | 13 #include "bindings/v8/V8DOMConfiguration.h" |
14 #include "bindings/v8/V8HiddenValue.h" | 14 #include "bindings/v8/V8HiddenValue.h" |
15 #include "bindings/v8/V8ObjectConstructor.h" | 15 #include "bindings/v8/V8ObjectConstructor.h" |
16 #include "core/dom/ContextFeatures.h" | 16 #include "core/dom/ContextFeatures.h" |
17 #include "core/dom/Document.h" | 17 #include "core/dom/Document.h" |
18 #include "platform/TraceEvent.h" | 18 #include "platform/TraceEvent.h" |
19 #include "wtf/GetPtr.h" | 19 #include "wtf/GetPtr.h" |
20 #include "wtf/RefPtr.h" | 20 #include "wtf/RefPtr.h" |
21 | 21 |
22 namespace WebCore { | 22 namespace WebCore { |
23 | 23 |
24 static void initializeScriptWrappableForInterface(TestInterface3* object) | 24 static void initializeScriptWrappableForInterface(TestSpecialOperationsCustom* o
bject) |
25 { | 25 { |
26 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 26 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
27 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface3::wrapperT
ypeInfo); | 27 ScriptWrappable::setTypeInfoInObject(object, &V8TestSpecialOperationsCus
tom::wrapperTypeInfo); |
28 else | 28 else |
29 ASSERT_NOT_REACHED(); | 29 ASSERT_NOT_REACHED(); |
30 } | 30 } |
31 | 31 |
32 } // namespace WebCore | 32 } // namespace WebCore |
33 | 33 |
34 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterface3* objec
t) | 34 void webCoreInitializeScriptWrappableForInterface(WebCore::TestSpecialOperations
Custom* object) |
35 { | 35 { |
36 WebCore::initializeScriptWrappableForInterface(object); | 36 WebCore::initializeScriptWrappableForInterface(object); |
37 } | 37 } |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 const WrapperTypeInfo V8TestInterface3::wrapperTypeInfo = { gin::kEmbedderBlink,
V8TestInterface3::domTemplate, V8TestInterface3::derefObject, 0, 0, V8TestInter
face3::visitDOMWrapper, V8TestInterface3::installPerContextEnabledMethods, 0, Wr
apperTypeObjectPrototype, false }; | 40 const WrapperTypeInfo V8TestSpecialOperationsCustom::wrapperTypeInfo = { gin::kE
mbedderBlink, V8TestSpecialOperationsCustom::domTemplate, V8TestSpecialOperation
sCustom::derefObject, 0, 0, 0, V8TestSpecialOperationsCustom::installPerContextE
nabledMethods, 0, WrapperTypeObjectPrototype, false }; |
41 | 41 |
42 namespace TestInterface3V8Internal { | 42 namespace TestSpecialOperationsCustomV8Internal { |
43 | 43 |
44 template <typename T> void V8_USE(T) { } | 44 template <typename T> void V8_USE(T) { } |
45 | 45 |
46 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 46 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
47 { | 47 { |
48 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 48 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
49 V8TestInterface3::indexedPropertyGetterCustom(index, info); | 49 V8TestSpecialOperationsCustom::indexedPropertyGetterCustom(index, info); |
50 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 50 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
51 } | 51 } |
52 | 52 |
53 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 53 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
54 { | 54 { |
55 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 55 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
56 V8TestInterface3::indexedPropertySetterCustom(index, v8Value, info); | 56 V8TestSpecialOperationsCustom::indexedPropertySetterCustom(index, v8Value, i
nfo); |
57 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 57 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
58 } | 58 } |
59 | 59 |
60 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 60 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
61 { | 61 { |
62 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 62 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
63 V8TestInterface3::indexedPropertyDeleterCustom(index, info); | 63 V8TestSpecialOperationsCustom::indexedPropertyDeleterCustom(index, info); |
64 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 64 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
65 } | 65 } |
66 | 66 |
67 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 67 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
68 { | 68 { |
69 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 69 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
70 V8TestInterface3::namedPropertyGetterCustom(name, info); | 70 V8TestSpecialOperationsCustom::namedPropertyGetterCustom(name, info); |
71 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 71 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
72 } | 72 } |
73 | 73 |
74 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 74 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
75 { | 75 { |
76 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 76 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
77 V8TestInterface3::namedPropertySetterCustom(name, v8Value, info); | 77 V8TestSpecialOperationsCustom::namedPropertySetterCustom(name, v8Value, info
); |
78 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 78 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
79 } | 79 } |
80 | 80 |
81 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) | 81 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) |
82 { | 82 { |
83 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 83 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
84 V8TestInterface3::namedPropertyQueryCustom(name, info); | 84 V8TestSpecialOperationsCustom::namedPropertyQueryCustom(name, info); |
85 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 85 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
86 } | 86 } |
87 | 87 |
88 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Boolean>& info) | 88 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Boolean>& info) |
89 { | 89 { |
90 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 90 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
91 V8TestInterface3::namedPropertyDeleterCustom(name, info); | 91 V8TestSpecialOperationsCustom::namedPropertyDeleterCustom(name, info); |
92 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 92 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
93 } | 93 } |
94 | 94 |
95 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 95 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
96 { | 96 { |
97 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 97 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
98 V8TestInterface3::namedPropertyEnumeratorCustom(info); | 98 V8TestSpecialOperationsCustom::namedPropertyEnumeratorCustom(info); |
99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
100 } | 100 } |
101 | 101 |
102 } // namespace TestInterface3V8Internal | 102 } // namespace TestSpecialOperationsCustomV8Internal |
103 | 103 |
104 static void configureV8TestInterface3Template(v8::Handle<v8::FunctionTemplate> f
unctionTemplate, v8::Isolate* isolate) | 104 static void configureV8TestSpecialOperationsCustomTemplate(v8::Handle<v8::Functi
onTemplate> functionTemplate, v8::Isolate* isolate) |
105 { | 105 { |
106 functionTemplate->ReadOnlyPrototype(); | 106 functionTemplate->ReadOnlyPrototype(); |
107 | 107 |
108 v8::Local<v8::Signature> defaultSignature; | 108 v8::Local<v8::Signature> defaultSignature; |
109 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterface3", v8::Local<v8::FunctionTemplate>(), V8TestInterface3::inte
rnalFieldCount, | 109 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestSpecialOperationsCustom", v8::Local<v8::FunctionTemplate>(), V8TestSpe
cialOperationsCustom::internalFieldCount, |
110 0, 0, | 110 0, 0, |
111 0, 0, | 111 0, 0, |
112 0, 0, | 112 0, 0, |
113 isolate); | 113 isolate); |
114 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 114 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
115 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 115 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
116 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterfac
e3V8Internal::indexedPropertyGetterCallback, TestInterface3V8Internal::indexedPr
opertySetterCallback, 0, TestInterface3V8Internal::indexedPropertyDeleterCallbac
k, indexedPropertyEnumerator<TestInterface3>); | 116 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO
perationsCustomV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsC
ustomV8Internal::indexedPropertySetterCallback, 0, TestSpecialOperationsCustomV8
Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestSpecialO
perationsCustom>); |
117 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterface3
V8Internal::namedPropertyGetterCallback, TestInterface3V8Internal::namedProperty
SetterCallback, TestInterface3V8Internal::namedPropertyQueryCallback, TestInterf
ace3V8Internal::namedPropertyDeleterCallback, TestInterface3V8Internal::namedPro
pertyEnumeratorCallback); | 117 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe
rationsCustomV8Internal::namedPropertyGetterCallback, TestSpecialOperationsCusto
mV8Internal::namedPropertySetterCallback, TestSpecialOperationsCustomV8Internal:
:namedPropertyQueryCallback, TestSpecialOperationsCustomV8Internal::namedPropert
yDeleterCallback, TestSpecialOperationsCustomV8Internal::namedPropertyEnumerator
Callback); |
118 | 118 |
119 // Custom toString template | 119 // Custom toString template |
120 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 120 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
121 } | 121 } |
122 | 122 |
123 v8::Handle<v8::FunctionTemplate> V8TestInterface3::domTemplate(v8::Isolate* isol
ate) | 123 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsCustom::domTemplate(v8::
Isolate* isolate) |
124 { | 124 { |
125 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 125 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
126 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); | 126 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); |
127 if (!result.IsEmpty()) | 127 if (!result.IsEmpty()) |
128 return result; | 128 return result; |
129 | 129 |
130 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 130 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
131 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 131 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
132 configureV8TestInterface3Template(result, isolate); | 132 configureV8TestSpecialOperationsCustomTemplate(result, isolate); |
133 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; | 133 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; |
134 return result; | 134 return result; |
135 } | 135 } |
136 | 136 |
137 bool V8TestInterface3::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* i
solate) | 137 bool V8TestSpecialOperationsCustom::hasInstance(v8::Handle<v8::Value> v8Value, v
8::Isolate* isolate) |
138 { | 138 { |
139 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 139 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
140 } | 140 } |
141 | 141 |
142 v8::Handle<v8::Object> V8TestInterface3::findInstanceInPrototypeChain(v8::Handle
<v8::Value> v8Value, v8::Isolate* isolate) | 142 v8::Handle<v8::Object> V8TestSpecialOperationsCustom::findInstanceInPrototypeCha
in(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
143 { | 143 { |
144 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 144 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
145 } | 145 } |
146 | 146 |
147 TestInterface3* V8TestInterface3::toNativeWithTypeCheck(v8::Isolate* isolate, v8
::Handle<v8::Value> value) | 147 TestSpecialOperationsCustom* V8TestSpecialOperationsCustom::toNativeWithTypeChec
k(v8::Isolate* isolate, v8::Handle<v8::Value> value) |
148 { | 148 { |
149 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; | 149 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
150 } | 150 } |
151 | 151 |
152 v8::Handle<v8::Object> V8TestInterface3::createWrapper(PassRefPtr<TestInterface3
> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 152 v8::Handle<v8::Object> V8TestSpecialOperationsCustom::createWrapper(PassRefPtr<T
estSpecialOperationsCustom> impl, v8::Handle<v8::Object> creationContext, v8::Is
olate* isolate) |
153 { | 153 { |
154 ASSERT(impl); | 154 ASSERT(impl); |
155 ASSERT(!DOMDataStore::containsWrapper<V8TestInterface3>(impl.get(), isolate)
); | 155 ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsCustom>(impl.ge
t(), isolate)); |
156 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 156 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
157 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 157 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
158 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 158 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
159 // the same object de-ref functions, though, so use that as the basis of
the check. | 159 // the same object de-ref functions, though, so use that as the basis of
the check. |
160 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 160 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
161 } | 161 } |
162 | 162 |
163 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); | 163 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
164 if (UNLIKELY(wrapper.IsEmpty())) | 164 if (UNLIKELY(wrapper.IsEmpty())) |
165 return wrapper; | 165 return wrapper; |
166 | 166 |
167 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 167 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
168 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface3>(impl, &wrapperTyp
eInfo, wrapper, isolate, WrapperConfiguration::Dependent); | 168 V8DOMWrapper::associateObjectWithWrapper<V8TestSpecialOperationsCustom>(impl
, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
169 return wrapper; | 169 return wrapper; |
170 } | 170 } |
171 | 171 |
172 void V8TestInterface3::derefObject(void* object) | 172 void V8TestSpecialOperationsCustom::derefObject(void* object) |
173 { | 173 { |
174 fromInternalPointer(object)->deref(); | 174 fromInternalPointer(object)->deref(); |
175 } | 175 } |
176 | 176 |
177 template<> | 177 template<> |
178 v8::Handle<v8::Value> toV8NoInline(TestInterface3* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 178 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsCustom* impl, v8::Handle
<v8::Object> creationContext, v8::Isolate* isolate) |
179 { | 179 { |
180 return toV8(impl, creationContext, isolate); | 180 return toV8(impl, creationContext, isolate); |
181 } | 181 } |
182 | 182 |
183 } // namespace WebCore | 183 } // namespace WebCore |
OLD | NEW |