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 "V8TestInterface2.h" | 8 #include "V8TestInterface2.h" |
9 | 9 |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| 11 #include "bindings/core/v8/ScriptState.h" |
11 #include "bindings/core/v8/V8DOMConfiguration.h" | 12 #include "bindings/core/v8/V8DOMConfiguration.h" |
12 #include "bindings/core/v8/V8GCController.h" | 13 #include "bindings/core/v8/V8GCController.h" |
13 #include "bindings/core/v8/V8HiddenValue.h" | 14 #include "bindings/core/v8/V8HiddenValue.h" |
| 15 #include "bindings/core/v8/V8Iterator.h" |
14 #include "bindings/core/v8/V8ObjectConstructor.h" | 16 #include "bindings/core/v8/V8ObjectConstructor.h" |
15 #include "bindings/core/v8/V8TestInterfaceEmpty.h" | 17 #include "bindings/core/v8/V8TestInterfaceEmpty.h" |
16 #include "core/dom/ContextFeatures.h" | 18 #include "core/dom/ContextFeatures.h" |
17 #include "core/dom/Document.h" | 19 #include "core/dom/Document.h" |
18 #include "core/dom/Element.h" | 20 #include "core/dom/Element.h" |
19 #include "core/frame/LocalDOMWindow.h" | 21 #include "core/frame/LocalDOMWindow.h" |
20 #include "platform/RuntimeEnabledFeatures.h" | 22 #include "platform/RuntimeEnabledFeatures.h" |
21 #include "platform/TraceEvent.h" | 23 #include "platform/TraceEvent.h" |
22 #include "wtf/GetPtr.h" | 24 #include "wtf/GetPtr.h" |
23 #include "wtf/RefPtr.h" | 25 #include "wtf/RefPtr.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); | 226 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); |
225 } | 227 } |
226 | 228 |
227 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 229 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
228 { | 230 { |
229 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 231 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
230 TestInterface2V8Internal::toStringMethod(info); | 232 TestInterface2V8Internal::toStringMethod(info); |
231 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 233 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
232 } | 234 } |
233 | 235 |
| 236 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 237 { |
| 238 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 239 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 240 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
| 241 RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState); |
| 242 if (exceptionState.hadException()) { |
| 243 exceptionState.throwIfNeeded(); |
| 244 return; |
| 245 } |
| 246 v8SetReturnValue(info, result.release()); |
| 247 } |
| 248 |
| 249 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 250 { |
| 251 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 252 TestInterface2V8Internal::iteratorMethod(info); |
| 253 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 254 } |
| 255 |
234 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 256 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
235 { | 257 { |
236 RefPtr<TestInterface2> impl = TestInterface2::create(); | 258 RefPtr<TestInterface2> impl = TestInterface2::create(); |
237 v8::Local<v8::Object> wrapper = info.Holder(); | 259 v8::Local<v8::Object> wrapper = info.Holder(); |
238 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface2::wrapperType
Info, wrapper); | 260 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface2::wrapperType
Info, wrapper); |
239 v8SetReturnValue(info, wrapper); | 261 v8SetReturnValue(info, wrapper); |
240 } | 262 } |
241 | 263 |
242 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 264 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
243 { | 265 { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 ALLOW_UNUSED_LOCAL(instanceTemplate); | 499 ALLOW_UNUSED_LOCAL(instanceTemplate); |
478 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 500 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
479 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 501 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
480 if (RuntimeEnabledFeatures::featureNameEnabled()) { | 502 if (RuntimeEnabledFeatures::featureNameEnabled()) { |
481 static const V8DOMConfiguration::ConstantConfiguration constantConfigura
tion = {"CONST_VALUE_1", 1, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}
; | 503 static const V8DOMConfiguration::ConstantConfiguration constantConfigura
tion = {"CONST_VALUE_1", 1, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}
; |
482 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototyp
eTemplate, &constantConfiguration, 1); | 504 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototyp
eTemplate, &constantConfiguration, 1); |
483 } | 505 } |
484 static_assert(1 == TestInterface2::CONST_VALUE_1, "the value of TestInterfac
e2_CONST_VALUE_1 does not match with implementation"); | 506 static_assert(1 == TestInterface2::CONST_VALUE_1, "the value of TestInterfac
e2_CONST_VALUE_1 does not match with implementation"); |
485 functionTemplate->InstanceTemplate()->SetHandler(v8::IndexedPropertyHandlerC
onfiguration(TestInterface2V8Internal::indexedPropertyGetterCallback, TestInterf
ace2V8Internal::indexedPropertySetterCallback, 0, TestInterface2V8Internal::inde
xedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface2>)); | 507 functionTemplate->InstanceTemplate()->SetHandler(v8::IndexedPropertyHandlerC
onfiguration(TestInterface2V8Internal::indexedPropertyGetterCallback, TestInterf
ace2V8Internal::indexedPropertySetterCallback, 0, TestInterface2V8Internal::inde
xedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface2>)); |
486 functionTemplate->InstanceTemplate()->SetHandler(v8::NamedPropertyHandlerCon
figuration(TestInterface2V8Internal::namedPropertyGetterCallback, TestInterface2
V8Internal::namedPropertySetterCallback, TestInterface2V8Internal::namedProperty
QueryCallback, TestInterface2V8Internal::namedPropertyDeleterCallback, TestInter
face2V8Internal::namedPropertyEnumeratorCallback)); | 508 functionTemplate->InstanceTemplate()->SetHandler(v8::NamedPropertyHandlerCon
figuration(TestInterface2V8Internal::namedPropertyGetterCallback, TestInterface2
V8Internal::namedPropertySetterCallback, TestInterface2V8Internal::namedProperty
QueryCallback, TestInterface2V8Internal::namedPropertyDeleterCallback, TestInter
face2V8Internal::namedPropertyEnumeratorCallback)); |
| 509 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI
teratorConfiguration = { v8::Symbol::GetIterator, TestInterface2V8Internal::iter
atorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; |
| 510 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::D
ontDelete, symbolKeyedIteratorConfiguration, isolate); |
487 | 511 |
488 // Custom toString template | 512 // Custom toString template |
489 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 513 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
490 } | 514 } |
491 | 515 |
492 v8::Local<v8::FunctionTemplate> V8TestInterface2::domTemplate(v8::Isolate* isola
te) | 516 v8::Local<v8::FunctionTemplate> V8TestInterface2::domTemplate(v8::Isolate* isola
te) |
493 { | 517 { |
494 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterface2Template); | 518 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterface2Template); |
495 } | 519 } |
496 | 520 |
(...skipping 16 matching lines...) Expand all Loading... |
513 { | 537 { |
514 scriptWrappable->toImpl<TestInterface2>()->ref(); | 538 scriptWrappable->toImpl<TestInterface2>()->ref(); |
515 } | 539 } |
516 | 540 |
517 void V8TestInterface2::derefObject(ScriptWrappable* scriptWrappable) | 541 void V8TestInterface2::derefObject(ScriptWrappable* scriptWrappable) |
518 { | 542 { |
519 scriptWrappable->toImpl<TestInterface2>()->deref(); | 543 scriptWrappable->toImpl<TestInterface2>()->deref(); |
520 } | 544 } |
521 | 545 |
522 } // namespace blink | 546 } // namespace blink |
OLD | NEW |