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 "V8TestInterfaceEventTarget.h" | 8 #include "V8TestInterfaceEventTarget.h" |
9 | 9 |
10 #include "RuntimeEnabledFeatures.h" | 10 #include "RuntimeEnabledFeatures.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 } // namespace WebCore | 32 } // namespace WebCore |
33 | 33 |
34 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEventTar
get* object) | 34 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEventTar
get* object) |
35 { | 35 { |
36 WebCore::initializeScriptWrappableForInterface(object); | 36 WebCore::initializeScriptWrappableForInterface(object); |
37 } | 37 } |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 const WrapperTypeInfo V8TestInterfaceEventTarget::wrapperTypeInfo = { gin::kEmbe
dderBlink, V8TestInterfaceEventTarget::domTemplate, V8TestInterfaceEventTarget::
derefObject, 0, V8TestInterfaceEventTarget::toEventTarget, 0, V8TestInterfaceEve
ntTarget::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, Wrap
perTypeObjectPrototype, RefCountedObject }; | 40 const WrapperTypeInfo V8TestInterfaceEventTarget::wrapperTypeInfo = { gin::kEmbe
dderBlink, V8TestInterfaceEventTarget::domTemplate, V8TestInterfaceEventTarget::
derefObject, 0, V8TestInterfaceEventTarget::toEventTarget, 0, V8TestInterfaceEve
ntTarget::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, Wrap
perTypeObjectPrototype, WillBeGarbageCollectedObject }; |
41 | 41 |
42 namespace TestInterfaceEventTargetV8Internal { | 42 namespace TestInterfaceEventTargetV8Internal { |
43 | 43 |
44 template <typename T> void V8_USE(T) { } | 44 template <typename T> void V8_USE(T) { } |
45 | 45 |
46 } // namespace TestInterfaceEventTargetV8Internal | 46 } // namespace TestInterfaceEventTargetV8Internal |
47 | 47 |
48 const WrapperTypeInfo V8TestInterfaceEventTargetConstructor::wrapperTypeInfo = {
gin::kEmbedderBlink, V8TestInterfaceEventTargetConstructor::domTemplate, V8Test
InterfaceEventTarget::derefObject, 0, V8TestInterfaceEventTarget::toEventTarget,
0, V8TestInterfaceEventTarget::installPerContextEnabledMethods, 0, WrapperTypeO
bjectPrototype, RefCountedObject }; | 48 const WrapperTypeInfo V8TestInterfaceEventTargetConstructor::wrapperTypeInfo = {
gin::kEmbedderBlink, V8TestInterfaceEventTargetConstructor::domTemplate, V8Test
InterfaceEventTarget::derefObject, 0, V8TestInterfaceEventTarget::toEventTarget,
0, V8TestInterfaceEventTarget::installPerContextEnabledMethods, 0, WrapperTypeO
bjectPrototype, WillBeGarbageCollectedObject }; |
49 | 49 |
50 static void V8TestInterfaceEventTargetConstructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 50 static void V8TestInterfaceEventTargetConstructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
51 { | 51 { |
52 v8::Isolate* isolate = info.GetIsolate(); | 52 v8::Isolate* isolate = info.GetIsolate(); |
53 if (!info.IsConstructCall()) { | 53 if (!info.IsConstructCall()) { |
54 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Name
"), isolate); | 54 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Name
"), isolate); |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject
) { | 58 if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject
) { |
59 v8SetReturnValue(info, info.Holder()); | 59 v8SetReturnValue(info, info.Holder()); |
60 return; | 60 return; |
61 } | 61 } |
62 | 62 |
63 Document* document = currentDOMWindow(isolate)->document(); | 63 Document* document = currentDOMWindow(isolate)->document(); |
64 ASSERT(document); | 64 ASSERT(document); |
65 | 65 |
66 // Make sure the document is added to the DOM Node map. Otherwise, the TestI
nterfaceEventTarget instance | 66 // Make sure the document is added to the DOM Node map. Otherwise, the TestI
nterfaceEventTarget instance |
67 // may end up being the only node in the map and get garbage-collected prema
turely. | 67 // may end up being the only node in the map and get garbage-collected prema
turely. |
68 toV8(document, info.Holder(), isolate); | 68 toV8(document, info.Holder(), isolate); |
69 | 69 |
70 RefPtr<TestInterfaceEventTarget> impl = TestInterfaceEventTarget::createForJ
SConstructor(*document); | 70 RefPtrWillBeRawPtr<TestInterfaceEventTarget> impl = TestInterfaceEventTarget
::createForJSConstructor(*document); |
71 | 71 |
72 v8::Handle<v8::Object> wrapper = info.Holder(); | 72 v8::Handle<v8::Object> wrapper = info.Holder(); |
73 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventTarget>(impl.re
lease(), &V8TestInterfaceEventTargetConstructor::wrapperTypeInfo, wrapper, isola
te, WrapperConfiguration::Independent); | 73 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventTarget>(impl.re
lease(), &V8TestInterfaceEventTargetConstructor::wrapperTypeInfo, wrapper, isola
te, WrapperConfiguration::Independent); |
74 v8SetReturnValue(info, wrapper); | 74 v8SetReturnValue(info, wrapper); |
75 } | 75 } |
76 | 76 |
77 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEventTargetConstructor::domTempl
ate(v8::Isolate* isolate) | 77 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEventTargetConstructor::domTempl
ate(v8::Isolate* isolate) |
78 { | 78 { |
79 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 79 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
80 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 80 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 TestInterfaceEventTarget* V8TestInterfaceEventTarget::toNativeWithTypeCheck(v8::
Isolate* isolate, v8::Handle<v8::Value> value) | 136 TestInterfaceEventTarget* V8TestInterfaceEventTarget::toNativeWithTypeCheck(v8::
Isolate* isolate, v8::Handle<v8::Value> value) |
137 { | 137 { |
138 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; | 138 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
139 } | 139 } |
140 | 140 |
141 EventTarget* V8TestInterfaceEventTarget::toEventTarget(v8::Handle<v8::Object> ob
ject) | 141 EventTarget* V8TestInterfaceEventTarget::toEventTarget(v8::Handle<v8::Object> ob
ject) |
142 { | 142 { |
143 return toNative(object); | 143 return toNative(object); |
144 } | 144 } |
145 | 145 |
146 v8::Handle<v8::Object> V8TestInterfaceEventTarget::createWrapper(PassRefPtr<Test
InterfaceEventTarget> impl, v8::Handle<v8::Object> creationContext, v8::Isolate*
isolate) | 146 v8::Handle<v8::Object> V8TestInterfaceEventTarget::createWrapper(PassRefPtrWillB
eRawPtr<TestInterfaceEventTarget> impl, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate) |
147 { | 147 { |
148 ASSERT(impl); | 148 ASSERT(impl); |
149 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEventTarget>(impl.get()
, isolate)); | 149 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEventTarget>(impl.get()
, isolate)); |
150 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 150 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
151 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get
())->typeInfo(); | 151 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get
())->typeInfo(); |
152 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 152 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
153 // the same object de-ref functions, though, so use that as the basis of
the check. | 153 // the same object de-ref functions, though, so use that as the basis of
the check. |
154 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 154 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
155 } | 155 } |
156 | 156 |
157 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); | 157 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
158 if (UNLIKELY(wrapper.IsEmpty())) | 158 if (UNLIKELY(wrapper.IsEmpty())) |
159 return wrapper; | 159 return wrapper; |
160 | 160 |
161 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 161 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
162 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventTarget>(impl, &
wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); | 162 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventTarget>(impl, &
wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
163 return wrapper; | 163 return wrapper; |
164 } | 164 } |
165 | 165 |
166 void V8TestInterfaceEventTarget::derefObject(void* object) | 166 void V8TestInterfaceEventTarget::derefObject(void* object) |
167 { | 167 { |
| 168 #if !ENABLE(OILPAN) |
168 fromInternalPointer(object)->deref(); | 169 fromInternalPointer(object)->deref(); |
| 170 #endif // !ENABLE(OILPAN) |
169 } | 171 } |
170 | 172 |
171 template<> | 173 template<> |
172 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventTarget* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 174 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventTarget* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
173 { | 175 { |
174 return toV8(impl, creationContext, isolate); | 176 return toV8(impl, creationContext, isolate); |
175 } | 177 } |
176 | 178 |
177 } // namespace WebCore | 179 } // namespace WebCore |
OLD | NEW |