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 "V8TestInterfaceGarbageCollected.h" | 8 #include "V8TestInterfaceGarbageCollected.h" |
9 | 9 |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 const WrapperTypeInfo V8TestInterfaceGarbageCollected::wrapperTypeInfo = { gin::
kEmbedderBlink, V8TestInterfaceGarbageCollected::domTemplate, V8TestInterfaceGar
bageCollected::refObject, V8TestInterfaceGarbageCollected::derefObject, V8TestIn
terfaceGarbageCollected::trace, 0, 0, V8TestInterfaceGarbageCollected::installCo
nditionallyEnabledMethods, V8TestInterfaceGarbageCollected::installConditionally
EnabledProperties, &V8EventTarget::wrapperTypeInfo, WrapperTypeInfo::WrapperType
ObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::InheritFromEve
ntTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::GarbageCollectedObject
}; | 25 const WrapperTypeInfo V8TestInterfaceGarbageCollected::wrapperTypeInfo = { gin::
kEmbedderBlink, V8TestInterfaceGarbageCollected::domTemplate, V8TestInterfaceGar
bageCollected::refObject, V8TestInterfaceGarbageCollected::derefObject, V8TestIn
terfaceGarbageCollected::trace, 0, 0, V8TestInterfaceGarbageCollected::installCo
nditionallyEnabledMethods, V8TestInterfaceGarbageCollected::installConditionally
EnabledProperties, &V8EventTarget::wrapperTypeInfo, WrapperTypeInfo::WrapperType
ObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::InheritFromEve
ntTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::GarbageCollectedObject
}; |
26 | 26 |
27 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eGarbageCollected.h. | 27 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eGarbageCollected.h. |
28 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 28 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
29 // bindings/core/v8/ScriptWrappable.h. | 29 // bindings/core/v8/ScriptWrappable.h. |
30 const WrapperTypeInfo& TestInterfaceGarbageCollected::s_wrapperTypeInfo = V8Test
InterfaceGarbageCollected::wrapperTypeInfo; | 30 const WrapperTypeInfo& TestInterfaceGarbageCollected::s_wrapperTypeInfo = V8Test
InterfaceGarbageCollected::wrapperTypeInfo; |
31 | 31 |
32 namespace TestInterfaceGarbageCollectedV8Internal { | 32 namespace TestInterfaceGarbageCollectedV8Internal { |
33 | 33 |
34 static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info
) | 34 static void attr1AttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info
) |
35 { | 35 { |
36 v8::Local<v8::Object> holder = info.Holder(); | 36 v8::Local<v8::Object> holder = info.Holder(); |
37 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(holder); | 37 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(holder); |
38 v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl); | 38 v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl); |
39 } | 39 } |
40 | 40 |
41 static void attr1AttributeGetterCallback(v8::Local<v8::String>, const v8::Proper
tyCallbackInfo<v8::Value>& info) | 41 static void attr1AttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
42 { | 42 { |
43 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 43 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
44 TestInterfaceGarbageCollectedV8Internal::attr1AttributeGetter(info); | 44 TestInterfaceGarbageCollectedV8Internal::attr1AttributeGetter(info); |
45 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 45 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
46 } | 46 } |
47 | 47 |
48 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Propert
yCallbackInfo<void>& info) | 48 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Functio
nCallbackInfo<v8::Value>& info) |
49 { | 49 { |
50 v8::Local<v8::Object> holder = info.Holder(); | 50 v8::Local<v8::Object> holder = info.Holder(); |
51 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(holder); | 51 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(holder); |
52 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::t
oImplWithTypeCheck(info.GetIsolate(), v8Value); | 52 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::t
oImplWithTypeCheck(info.GetIsolate(), v8Value); |
53 impl->setAttr1(WTF::getPtr(cppValue)); | 53 impl->setAttr1(WTF::getPtr(cppValue)); |
54 } | 54 } |
55 | 55 |
56 static void attr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Va
lue> v8Value, const v8::PropertyCallbackInfo<void>& info) | 56 static void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
57 { | 57 { |
| 58 v8::Local<v8::Value> v8Value = info[0]; |
58 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 59 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
59 TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info)
; | 60 TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info)
; |
60 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 61 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
61 } | 62 } |
62 | 63 |
63 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 64 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
64 { | 65 { |
65 if (UNLIKELY(info.Length() < 1)) { | 66 if (UNLIKELY(info.Length() < 1)) { |
66 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in
fo.GetIsolate(), "func", "TestInterfaceGarbageCollected", 1, info.Length()), inf
o.GetIsolate()); | 67 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in
fo.GetIsolate(), "func", "TestInterfaceGarbageCollected", 1, info.Length()), inf
o.GetIsolate()); |
67 return; | 68 return; |
(...skipping 24 matching lines...) Expand all Loading... |
92 TOSTRING_VOID_INTERNAL(str, info[0]); | 93 TOSTRING_VOID_INTERNAL(str, info[0]); |
93 } | 94 } |
94 RawPtr<TestInterfaceGarbageCollected> impl = TestInterfaceGarbageCollected::
create(str); | 95 RawPtr<TestInterfaceGarbageCollected> impl = TestInterfaceGarbageCollected::
create(str); |
95 v8::Local<v8::Object> wrapper = info.Holder(); | 96 v8::Local<v8::Object> wrapper = info.Holder(); |
96 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceGarbageCollect
ed::wrapperTypeInfo, wrapper); | 97 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceGarbageCollect
ed::wrapperTypeInfo, wrapper); |
97 v8SetReturnValue(info, wrapper); | 98 v8SetReturnValue(info, wrapper); |
98 } | 99 } |
99 | 100 |
100 } // namespace TestInterfaceGarbageCollectedV8Internal | 101 } // namespace TestInterfaceGarbageCollectedV8Internal |
101 | 102 |
102 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceGarbageCo
llectedAttributes[] = { | 103 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceGarbageCol
lectedAccessors[] = { |
103 {"attr1", TestInterfaceGarbageCollectedV8Internal::attr1AttributeGetterCallb
ack, TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetterCallback, 0, 0
, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttrib
ute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnI
nstance}, | 104 {"attr1", TestInterfaceGarbageCollectedV8Internal::attr1AttributeGetterCallb
ack, TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetterCallback, 0, 0
, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttrib
ute>(v8::None), V8DOMConfiguration::ExposedToAllScripts}, |
104 }; | 105 }; |
105 | 106 |
106 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceGarbageColle
ctedMethods[] = { | 107 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceGarbageColle
ctedMethods[] = { |
107 {"func", TestInterfaceGarbageCollectedV8Internal::funcMethodCallback, 0, 1,
V8DOMConfiguration::ExposedToAllScripts}, | 108 {"func", TestInterfaceGarbageCollectedV8Internal::funcMethodCallback, 0, 1,
V8DOMConfiguration::ExposedToAllScripts}, |
108 }; | 109 }; |
109 | 110 |
110 void V8TestInterfaceGarbageCollected::constructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 111 void V8TestInterfaceGarbageCollected::constructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
111 { | 112 { |
112 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); | 113 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); |
113 if (!info.IsConstructCall()) { | 114 if (!info.IsConstructCall()) { |
114 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceGarbageCollected")); | 115 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceGarbageCollected")); |
115 return; | 116 return; |
116 } | 117 } |
117 | 118 |
118 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { | 119 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { |
119 v8SetReturnValue(info, info.Holder()); | 120 v8SetReturnValue(info, info.Holder()); |
120 return; | 121 return; |
121 } | 122 } |
122 | 123 |
123 TestInterfaceGarbageCollectedV8Internal::constructor(info); | 124 TestInterfaceGarbageCollectedV8Internal::constructor(info); |
124 } | 125 } |
125 | 126 |
126 static void installV8TestInterfaceGarbageCollectedTemplate(v8::Local<v8::Functio
nTemplate> functionTemplate, v8::Isolate* isolate) | 127 static void installV8TestInterfaceGarbageCollectedTemplate(v8::Local<v8::Functio
nTemplate> functionTemplate, v8::Isolate* isolate) |
127 { | 128 { |
128 functionTemplate->ReadOnlyPrototype(); | 129 functionTemplate->ReadOnlyPrototype(); |
129 | 130 |
130 v8::Local<v8::Signature> defaultSignature; | 131 v8::Local<v8::Signature> defaultSignature; |
131 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceGarbageCollected", V8EventTarget::domTemplate(isolat
e), V8TestInterfaceGarbageCollected::internalFieldCount, | 132 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceGarbageCollected", V8EventTarget::domTemplate(isolat
e), V8TestInterfaceGarbageCollected::internalFieldCount, |
132 V8TestInterfaceGarbageCollectedAttributes, WTF_ARRAY_LENGTH(V8TestInterf
aceGarbageCollectedAttributes), | |
133 0, 0, | 133 0, 0, |
| 134 V8TestInterfaceGarbageCollectedAccessors, WTF_ARRAY_LENGTH(V8TestInterfa
ceGarbageCollectedAccessors), |
134 V8TestInterfaceGarbageCollectedMethods, WTF_ARRAY_LENGTH(V8TestInterface
GarbageCollectedMethods)); | 135 V8TestInterfaceGarbageCollectedMethods, WTF_ARRAY_LENGTH(V8TestInterface
GarbageCollectedMethods)); |
135 functionTemplate->SetCallHandler(V8TestInterfaceGarbageCollected::constructo
rCallback); | 136 functionTemplate->SetCallHandler(V8TestInterfaceGarbageCollected::constructo
rCallback); |
136 functionTemplate->SetLength(1); | 137 functionTemplate->SetLength(1); |
137 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 138 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
138 ALLOW_UNUSED_LOCAL(instanceTemplate); | 139 ALLOW_UNUSED_LOCAL(instanceTemplate); |
139 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 140 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
140 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 141 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
141 | 142 |
142 // Custom toString template | 143 // Custom toString template |
143 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 144 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
(...skipping 21 matching lines...) Expand all Loading... |
165 | 166 |
166 void V8TestInterfaceGarbageCollected::refObject(ScriptWrappable* scriptWrappable
) | 167 void V8TestInterfaceGarbageCollected::refObject(ScriptWrappable* scriptWrappable
) |
167 { | 168 { |
168 } | 169 } |
169 | 170 |
170 void V8TestInterfaceGarbageCollected::derefObject(ScriptWrappable* scriptWrappab
le) | 171 void V8TestInterfaceGarbageCollected::derefObject(ScriptWrappable* scriptWrappab
le) |
171 { | 172 { |
172 } | 173 } |
173 | 174 |
174 } // namespace blink | 175 } // namespace blink |
OLD | NEW |