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 "V8TestInterfaceEmpty.h" | 8 #include "V8TestInterfacePython3.h" |
9 | 9 |
10 #include "RuntimeEnabledFeatures.h" | 10 #include "RuntimeEnabledFeatures.h" |
11 #include "bindings/v8/ExceptionState.h" | 11 #include "bindings/v8/ExceptionState.h" |
12 #include "bindings/v8/V8DOMConfiguration.h" | 12 #include "bindings/v8/V8DOMConfiguration.h" |
13 #include "bindings/v8/V8HiddenValue.h" | 13 #include "bindings/v8/V8HiddenValue.h" |
14 #include "bindings/v8/V8ObjectConstructor.h" | 14 #include "bindings/v8/V8ObjectConstructor.h" |
15 #include "core/dom/ContextFeatures.h" | 15 #include "core/dom/ContextFeatures.h" |
16 #include "core/dom/Document.h" | 16 #include "core/dom/Document.h" |
17 #include "platform/TraceEvent.h" | 17 #include "platform/TraceEvent.h" |
18 #include "wtf/GetPtr.h" | 18 #include "wtf/GetPtr.h" |
19 #include "wtf/RefPtr.h" | 19 #include "wtf/RefPtr.h" |
20 | 20 |
21 namespace WebCore { | 21 namespace WebCore { |
22 | 22 |
23 static void initializeScriptWrappableForInterface(TestInterfaceEmpty* object) | 23 static void initializeScriptWrappableForInterface(TestInterfacePython3* object) |
24 { | 24 { |
25 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 25 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
26 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceEmpty::wrap
perTypeInfo); | 26 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython3::wr
apperTypeInfo); |
27 else | 27 else |
28 ASSERT_NOT_REACHED(); | 28 ASSERT_NOT_REACHED(); |
29 } | 29 } |
30 | 30 |
31 } // namespace WebCore | 31 } // namespace WebCore |
32 | 32 |
33 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEmpty* o
bject) | 33 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfacePython3*
object) |
34 { | 34 { |
35 WebCore::initializeScriptWrappableForInterface(object); | 35 WebCore::initializeScriptWrappableForInterface(object); |
36 } | 36 } |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 const WrapperTypeInfo V8TestInterfaceEmpty::wrapperTypeInfo = { gin::kEmbedderBl
ink, V8TestInterfaceEmpty::domTemplate, V8TestInterfaceEmpty::derefObject, 0, 0,
0, V8TestInterfaceEmpty::installPerContextEnabledMethods, 0, WrapperTypeObjectP
rototype, false }; | 39 const WrapperTypeInfo V8TestInterfacePython3::wrapperTypeInfo = { gin::kEmbedder
Blink, V8TestInterfacePython3::domTemplate, V8TestInterfacePython3::derefObject,
0, 0, V8TestInterfacePython3::visitDOMWrapper, V8TestInterfacePython3::installP
erContextEnabledMethods, 0, WrapperTypeObjectPrototype, false }; |
40 | 40 |
41 namespace TestInterfaceEmptyV8Internal { | 41 namespace TestInterfacePython3V8Internal { |
42 | 42 |
43 template <typename T> void V8_USE(T) { } | 43 template <typename T> void V8_USE(T) { } |
44 | 44 |
45 } // namespace TestInterfaceEmptyV8Internal | 45 } // namespace TestInterfacePython3V8Internal |
46 | 46 |
47 static void configureV8TestInterfaceEmptyTemplate(v8::Handle<v8::FunctionTemplat
e> functionTemplate, v8::Isolate* isolate) | 47 static void configureV8TestInterfacePython3Template(v8::Handle<v8::FunctionTempl
ate> functionTemplate, v8::Isolate* isolate) |
48 { | 48 { |
49 functionTemplate->ReadOnlyPrototype(); | 49 functionTemplate->ReadOnlyPrototype(); |
50 | 50 |
51 v8::Local<v8::Signature> defaultSignature; | 51 v8::Local<v8::Signature> defaultSignature; |
52 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceEmpty", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceEmp
ty::internalFieldCount, | 52 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfacePython3", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceP
ython3::internalFieldCount, |
53 0, 0, | 53 0, 0, |
54 0, 0, | 54 0, 0, |
55 0, 0, | 55 0, 0, |
56 isolate); | 56 isolate); |
57 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 57 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
58 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 58 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
59 | 59 |
60 // Custom toString template | 60 // Custom toString template |
61 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 61 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
62 } | 62 } |
63 | 63 |
64 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEmpty::domTemplate(v8::Isolate*
isolate) | 64 v8::Handle<v8::FunctionTemplate> V8TestInterfacePython3::domTemplate(v8::Isolate
* isolate) |
65 { | 65 { |
66 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 66 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
67 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); | 67 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); |
68 if (!result.IsEmpty()) | 68 if (!result.IsEmpty()) |
69 return result; | 69 return result; |
70 | 70 |
71 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 71 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
72 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 72 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
73 configureV8TestInterfaceEmptyTemplate(result, isolate); | 73 configureV8TestInterfacePython3Template(result, isolate); |
74 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; | 74 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; |
75 return result; | 75 return result; |
76 } | 76 } |
77 | 77 |
78 bool V8TestInterfaceEmpty::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolat
e* isolate) | 78 bool V8TestInterfacePython3::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isol
ate* isolate) |
79 { | 79 { |
80 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 80 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
81 } | 81 } |
82 | 82 |
83 v8::Handle<v8::Object> V8TestInterfaceEmpty::findInstanceInPrototypeChain(v8::Ha
ndle<v8::Value> v8Value, v8::Isolate* isolate) | 83 v8::Handle<v8::Object> V8TestInterfacePython3::findInstanceInPrototypeChain(v8::
Handle<v8::Value> v8Value, v8::Isolate* isolate) |
84 { | 84 { |
85 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 85 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
86 } | 86 } |
87 | 87 |
88 TestInterfaceEmpty* V8TestInterfaceEmpty::toNativeWithTypeCheck(v8::Isolate* iso
late, v8::Handle<v8::Value> value) | 88 TestInterfacePython3* V8TestInterfacePython3::toNativeWithTypeCheck(v8::Isolate*
isolate, v8::Handle<v8::Value> value) |
89 { | 89 { |
90 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; | 90 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
91 } | 91 } |
92 | 92 |
93 v8::Handle<v8::Object> V8TestInterfaceEmpty::createWrapper(PassRefPtr<TestInterf
aceEmpty> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 93 v8::Handle<v8::Object> V8TestInterfacePython3::createWrapper(PassRefPtr<TestInte
rfacePython3> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate
) |
94 { | 94 { |
95 ASSERT(impl); | 95 ASSERT(impl); |
96 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEmpty>(impl.get(), isol
ate)); | 96 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfacePython3>(impl.get(), is
olate)); |
97 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 97 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
98 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 98 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
99 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 99 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
100 // the same object de-ref functions, though, so use that as the basis of
the check. | 100 // the same object de-ref functions, though, so use that as the basis of
the check. |
101 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 101 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
102 } | 102 } |
103 | 103 |
104 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); | 104 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
105 if (UNLIKELY(wrapper.IsEmpty())) | 105 if (UNLIKELY(wrapper.IsEmpty())) |
106 return wrapper; | 106 return wrapper; |
107 | 107 |
108 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 108 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
109 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEmpty>(impl, &wrappe
rTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); | 109 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfacePython3>(impl, &wrap
perTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent); |
110 return wrapper; | 110 return wrapper; |
111 } | 111 } |
112 | 112 |
113 void V8TestInterfaceEmpty::derefObject(void* object) | 113 void V8TestInterfacePython3::derefObject(void* object) |
114 { | 114 { |
115 fromInternalPointer(object)->deref(); | 115 fromInternalPointer(object)->deref(); |
116 } | 116 } |
117 | 117 |
118 template<> | 118 template<> |
119 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEmpty* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 119 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython3* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
120 { | 120 { |
121 return toV8(impl, creationContext, isolate); | 121 return toV8(impl, creationContext, isolate); |
122 } | 122 } |
123 | 123 |
124 } // namespace WebCore | 124 } // namespace WebCore |
OLD | NEW |