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 "V8TestInterfaceWillBeGarbageCollected.h" | 8 #include "V8TestInterfaceWillBeGarbageCollected.h" |
9 | 9 |
10 #include "bindings/tests/v8/V8TestInterfaceWillBeGarbageCollected.h" | 10 #include "bindings/tests/v8/V8TestInterfaceWillBeGarbageCollected.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (!info.IsConstructCall()) { | 132 if (!info.IsConstructCall()) { |
133 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test
Interface"), isolate); | 133 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test
Interface"), isolate); |
134 return; | 134 return; |
135 } | 135 } |
136 | 136 |
137 if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject
) { | 137 if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject
) { |
138 v8SetReturnValue(info, info.Holder()); | 138 v8SetReturnValue(info, info.Holder()); |
139 return; | 139 return; |
140 } | 140 } |
141 | 141 |
142 Document* documentPtr = currentDOMWindow(isolate)->document(); | 142 Document& document = *toDocument(currentExecutionContext(isolate)); |
143 ASSERT(documentPtr); | |
144 Document& document = *documentPtr; | |
145 | |
146 // Make sure the document is added to the DOM Node map. Otherwise, the TestI
nterfaceWillBeGarbageCollected instance | |
147 // may end up being the only node in the map and get garbage-collected prema
turely. | |
148 toV8(documentPtr, info.Holder(), isolate); | |
149 | 143 |
150 if (UNLIKELY(info.Length() < 1)) { | 144 if (UNLIKELY(info.Length() < 1)) { |
151 throwMinimumArityTypeErrorForConstructor("TestInterfaceWillBeGarbageColl
ected", 1, info.Length(), info.GetIsolate()); | 145 throwMinimumArityTypeErrorForConstructor("TestInterfaceWillBeGarbageColl
ected", 1, info.Length(), info.GetIsolate()); |
152 return; | 146 return; |
153 } | 147 } |
154 V8StringResource<> str; | 148 V8StringResource<> str; |
155 { | 149 { |
156 TOSTRING_VOID_INTERNAL(str, info[0]); | 150 TOSTRING_VOID_INTERNAL(str, info[0]); |
157 } | 151 } |
158 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = TestInterface
WillBeGarbageCollected::createForJSConstructor(str); | 152 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = TestInterface
WillBeGarbageCollected::createForJSConstructor(str); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 #endif // !ENABLE(OILPAN) | 268 #endif // !ENABLE(OILPAN) |
275 } | 269 } |
276 | 270 |
277 template<> | 271 template<> |
278 v8::Handle<v8::Value> toV8NoInline(TestInterfaceWillBeGarbageCollected* impl, v8
::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 272 v8::Handle<v8::Value> toV8NoInline(TestInterfaceWillBeGarbageCollected* impl, v8
::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
279 { | 273 { |
280 return toV8(impl, creationContext, isolate); | 274 return toV8(impl, creationContext, isolate); |
281 } | 275 } |
282 | 276 |
283 } // namespace WebCore | 277 } // namespace WebCore |
OLD | NEW |