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 "V8TestInterfaceDocument.h" | 8 #include "V8TestInterfaceDocument.h" |
9 | 9 |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
11 #include "bindings/core/v8/V8DOMConfiguration.h" | 11 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 12 #include "bindings/core/v8/V8Document.h" |
12 #include "bindings/core/v8/V8HiddenValue.h" | 13 #include "bindings/core/v8/V8HiddenValue.h" |
13 #include "bindings/core/v8/V8ObjectConstructor.h" | 14 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 15 #include "bindings/tests/idls/core/TestPartialInterface4.h" |
14 #include "core/dom/ContextFeatures.h" | 16 #include "core/dom/ContextFeatures.h" |
15 #include "core/dom/Document.h" | 17 #include "core/dom/Document.h" |
16 #include "platform/RuntimeEnabledFeatures.h" | 18 #include "platform/RuntimeEnabledFeatures.h" |
17 #include "platform/TraceEvent.h" | 19 #include "platform/TraceEvent.h" |
18 #include "wtf/GetPtr.h" | 20 #include "wtf/GetPtr.h" |
19 #include "wtf/RefPtr.h" | 21 #include "wtf/RefPtr.h" |
20 | 22 |
21 namespace blink { | 23 namespace blink { |
22 | 24 |
23 const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedde
rBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::refObject
, V8TestInterfaceDocument::derefObject, V8TestInterfaceDocument::trace, 0, 0, V8
TestInterfaceDocument::installConditionallyEnabledMethods, V8TestInterfaceDocume
nt::installConditionallyEnabledProperties, &V8Document::wrapperTypeInfo, Wrapper
TypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeI
nfo::InheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::WillBe
GarbageCollectedObject }; | 25 const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedde
rBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::refObject
, V8TestInterfaceDocument::derefObject, V8TestInterfaceDocument::trace, 0, 0, V8
TestInterfaceDocument::installConditionallyEnabledMethods, V8TestInterfaceDocume
nt::installConditionallyEnabledProperties, &V8Document::wrapperTypeInfo, Wrapper
TypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeI
nfo::InheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::WillBe
GarbageCollectedObject }; |
24 | 26 |
25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eDocument.h. | 27 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eDocument.h. |
26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 28 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
27 // bindings/core/v8/ScriptWrappable.h. | 29 // bindings/core/v8/ScriptWrappable.h. |
28 const WrapperTypeInfo& TestInterfaceDocument::s_wrapperTypeInfo = V8TestInterfac
eDocument::wrapperTypeInfo; | 30 const WrapperTypeInfo& TestInterfaceDocument::s_wrapperTypeInfo = V8TestInterfac
eDocument::wrapperTypeInfo; |
29 | 31 |
30 namespace TestInterfaceDocumentV8Internal { | 32 namespace TestInterfaceDocumentV8Internal { |
31 | 33 |
| 34 static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 35 { |
| 36 if (UNLIKELY(info.Length() < 1)) { |
| 37 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in
fo.GetIsolate(), "voidMethodDocument", "TestInterfaceDocument", 1, info.Length()
), info.GetIsolate()); |
| 38 return; |
| 39 } |
| 40 Document* document; |
| 41 { |
| 42 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); |
| 43 if (!document) { |
| 44 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("voidMethodDocument", "TestInterfaceDocument", "parameter 1 i
s not of type 'Document'.")); |
| 45 return; |
| 46 } |
| 47 } |
| 48 TestPartialInterface4::voidMethodDocument(document); |
| 49 } |
| 50 |
| 51 static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 52 { |
| 53 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 54 TestInterfaceDocumentV8Internal::voidMethodDocumentMethod(info); |
| 55 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 56 } |
| 57 |
32 } // namespace TestInterfaceDocumentV8Internal | 58 } // namespace TestInterfaceDocumentV8Internal |
33 | 59 |
34 static void installV8TestInterfaceDocumentTemplate(v8::Local<v8::FunctionTemplat
e> functionTemplate, v8::Isolate* isolate) | 60 static void installV8TestInterfaceDocumentTemplate(v8::Local<v8::FunctionTemplat
e> functionTemplate, v8::Isolate* isolate) |
35 { | 61 { |
36 functionTemplate->ReadOnlyPrototype(); | 62 functionTemplate->ReadOnlyPrototype(); |
37 | 63 |
38 v8::Local<v8::Signature> defaultSignature; | 64 v8::Local<v8::Signature> defaultSignature; |
39 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceDocument", V8Document::domTemplate(isolate), V8TestI
nterfaceDocument::internalFieldCount, | 65 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceDocument", V8Document::domTemplate(isolate), V8TestI
nterfaceDocument::internalFieldCount, |
40 0, 0, | 66 0, 0, |
41 0, 0, | 67 0, 0, |
42 0, 0); | 68 0, 0); |
43 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 69 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
44 ALLOW_UNUSED_LOCAL(instanceTemplate); | 70 ALLOW_UNUSED_LOCAL(instanceTemplate); |
45 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 71 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
46 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 72 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 73 const V8DOMConfiguration::MethodConfiguration voidMethodDocumentMethodConfig
uration = { |
| 74 "voidMethodDocument", TestInterfaceDocumentV8Internal::voidMethodDocumen
tMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts, |
| 75 }; |
| 76 V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::S
ignature>(), v8::None, voidMethodDocumentMethodConfiguration); |
47 | 77 |
48 // Custom toString template | 78 // Custom toString template |
49 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 79 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
50 } | 80 } |
51 | 81 |
52 v8::Local<v8::FunctionTemplate> V8TestInterfaceDocument::domTemplate(v8::Isolate
* isolate) | 82 v8::Local<v8::FunctionTemplate> V8TestInterfaceDocument::domTemplate(v8::Isolate
* isolate) |
53 { | 83 { |
54 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterfaceDocumentTemplate); | 84 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterfaceDocumentTemplate); |
55 } | 85 } |
56 | 86 |
(...skipping 20 matching lines...) Expand all Loading... |
77 } | 107 } |
78 | 108 |
79 void V8TestInterfaceDocument::derefObject(ScriptWrappable* scriptWrappable) | 109 void V8TestInterfaceDocument::derefObject(ScriptWrappable* scriptWrappable) |
80 { | 110 { |
81 #if !ENABLE(OILPAN) | 111 #if !ENABLE(OILPAN) |
82 scriptWrappable->toImpl<TestInterfaceDocument>()->deref(); | 112 scriptWrappable->toImpl<TestInterfaceDocument>()->deref(); |
83 #endif | 113 #endif |
84 } | 114 } |
85 | 115 |
86 } // namespace blink | 116 } // namespace blink |
OLD | NEW |