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 "V8TestInterfaceNamedConstructor.h" | 8 #include "V8TestInterfaceNamedConstructor.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/V8HiddenValue.h" | 12 #include "bindings/core/v8/V8HiddenValue.h" |
13 #include "bindings/core/v8/V8ObjectConstructor.h" | 13 #include "bindings/core/v8/V8ObjectConstructor.h" |
14 #include "core/dom/ContextFeatures.h" | 14 #include "core/dom/ContextFeatures.h" |
15 #include "core/dom/Document.h" | 15 #include "core/dom/Document.h" |
16 #include "core/frame/LocalDOMWindow.h" | 16 #include "core/frame/LocalDOMWindow.h" |
17 #include "platform/RuntimeEnabledFeatures.h" | 17 #include "platform/RuntimeEnabledFeatures.h" |
18 #include "platform/TraceEvent.h" | 18 #include "platform/TraceEvent.h" |
19 #include "wtf/GetPtr.h" | 19 #include "wtf/GetPtr.h" |
20 #include "wtf/RefPtr.h" | 20 #include "wtf/RefPtr.h" |
21 | 21 |
22 namespace blink { | 22 namespace blink { |
23 | 23 |
24 const WrapperTypeInfo V8TestInterfaceNamedConstructor::wrapperTypeInfo = { gin::
kEmbedderBlink, V8TestInterfaceNamedConstructor::domTemplate, V8TestInterfaceNam
edConstructor::refObject, V8TestInterfaceNamedConstructor::derefObject, V8TestIn
terfaceNamedConstructor::trace, V8TestInterfaceNamedConstructor::toActiveDOMObje
ct, 0, V8TestInterfaceNamedConstructor::installConditionallyEnabledMethods, V8Te
stInterfaceNamedConstructor::installConditionallyEnabledProperties, 0, WrapperTy
peInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeI
nfo::NotInheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::Ref
CountedObject }; | 24 const WrapperTypeInfo V8TestInterfaceNamedConstructor::wrapperTypeInfo = { gin::
kEmbedderBlink, V8TestInterfaceNamedConstructor::domTemplate, V8TestInterfaceNam
edConstructor::refObject, V8TestInterfaceNamedConstructor::derefObject, V8TestIn
terfaceNamedConstructor::trace, V8TestInterfaceNamedConstructor::toActiveDOMObje
ct, 0, V8TestInterfaceNamedConstructor::installConditionallyEnabledMethods, V8Te
stInterfaceNamedConstructor::installConditionallyEnabledProperties, "TestInterfa
ceNamedConstructor", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperType
Info::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo
::Dependent, WrapperTypeInfo::RefCountedObject }; |
25 | 25 |
26 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eNamedConstructor.h. | 26 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eNamedConstructor.h. |
27 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 27 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
28 // bindings/core/v8/ScriptWrappable.h. | 28 // bindings/core/v8/ScriptWrappable.h. |
29 const WrapperTypeInfo& TestInterfaceNamedConstructor::s_wrapperTypeInfo = V8Test
InterfaceNamedConstructor::wrapperTypeInfo; | 29 const WrapperTypeInfo& TestInterfaceNamedConstructor::s_wrapperTypeInfo = V8Test
InterfaceNamedConstructor::wrapperTypeInfo; |
30 | 30 |
31 namespace TestInterfaceNamedConstructorV8Internal { | 31 namespace TestInterfaceNamedConstructorV8Internal { |
32 | 32 |
33 template<class CallbackInfo> | 33 template<class CallbackInfo> |
34 static void TestInterfaceNamedConstructorForceSetAttributeOnThis(v8::Local<v8::N
ame> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) | 34 static void TestInterfaceNamedConstructorForceSetAttributeOnThis(v8::Local<v8::N
ame> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) |
35 { | 35 { |
36 ASSERT(info.This()->IsObject()); | 36 ASSERT(info.This()->IsObject()); |
37 v8::Local<v8::Object>::Cast(info.This())->ForceSet(name, v8Value); | 37 v8::Local<v8::Object>::Cast(info.This())->ForceSet(name, v8Value); |
38 } | 38 } |
39 | 39 |
| 40 static void TestInterfaceNamedConstructorConstructorAttributeSetterCallback(v8::
Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<vo
id>& info) |
| 41 { |
| 42 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 43 do { |
| 44 v8::Local<v8::Value> data = info.Data(); |
| 45 ASSERT(data->IsExternal()); |
| 46 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()-
>CreationContext()); |
| 47 if (!perContextData) |
| 48 break; |
| 49 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data); |
| 50 if (!wrapperTypeInfo) |
| 51 break; |
| 52 TestInterfaceNamedConstructorForceSetAttributeOnThis(v8String(info.GetIs
olate(), wrapperTypeInfo->interfaceName), v8Value, info); |
| 53 } while (false); // do ... while (false) just for use of break |
| 54 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 55 } |
| 56 |
40 static void testNamedConstructorConstructorAttributeAttributeSetter(v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 57 static void testNamedConstructorConstructorAttributeAttributeSetter(v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
41 { | 58 { |
42 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test
NamedConstructorConstructorAttribute"); | 59 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test
NamedConstructorConstructorAttribute"); |
43 TestInterfaceNamedConstructorForceSetAttributeOnThis(propertyName, v8Value,
info); | 60 TestInterfaceNamedConstructorForceSetAttributeOnThis(propertyName, v8Value,
info); |
44 } | 61 } |
45 | 62 |
46 static void testNamedConstructorConstructorAttributeAttributeSetterCallback(v8::
Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<vo
id>& info) | 63 static void testNamedConstructorConstructorAttributeAttributeSetterCallback(v8::
Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<vo
id>& info) |
47 { | 64 { |
48 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 65 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
49 TestInterfaceNamedConstructorV8Internal::testNamedConstructorConstructorAttr
ibuteAttributeSetter(v8Value, info); | 66 TestInterfaceNamedConstructorV8Internal::testNamedConstructorConstructorAttr
ibuteAttributeSetter(v8Value, info); |
50 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 67 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
51 } | 68 } |
52 | 69 |
53 } // namespace TestInterfaceNamedConstructorV8Internal | 70 } // namespace TestInterfaceNamedConstructorV8Internal |
54 | 71 |
55 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNamedCons
tructorAttributes[] = { | 72 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNamedCons
tructorAttributes[] = { |
56 {"testNamedConstructorConstructorAttribute", v8ConstructorAttributeGetterAsP
roperty, TestInterfaceNamedConstructorV8Internal::testNamedConstructorConstructo
rAttributeAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestNam
edConstructor::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAll
Scripts, V8DOMConfiguration::OnInstance}, | 73 {"testNamedConstructorConstructorAttribute", v8ConstructorAttributeGetter, T
estInterfaceNamedConstructorV8Internal::testNamedConstructorConstructorAttribute
AttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestNamedConstruc
tor::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<
v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V
8DOMConfiguration::OnInstance}, |
57 }; | 74 }; |
58 | 75 |
59 const WrapperTypeInfo V8TestInterfaceNamedConstructorConstructor::wrapperTypeInf
o = { gin::kEmbedderBlink, V8TestInterfaceNamedConstructorConstructor::domTempla
te, V8TestInterfaceNamedConstructor::refObject, V8TestInterfaceNamedConstructor:
:derefObject, V8TestInterfaceNamedConstructor::trace, V8TestInterfaceNamedConstr
uctor::toActiveDOMObject, 0, V8TestInterfaceNamedConstructor::installConditional
lyEnabledMethods, V8TestInterfaceNamedConstructor::installConditionallyEnabledPr
operties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::Objec
tClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Dependent
, WrapperTypeInfo::RefCountedObject }; | 76 const WrapperTypeInfo V8TestInterfaceNamedConstructorConstructor::wrapperTypeInf
o = { gin::kEmbedderBlink, V8TestInterfaceNamedConstructorConstructor::domTempla
te, V8TestInterfaceNamedConstructor::refObject, V8TestInterfaceNamedConstructor:
:derefObject, V8TestInterfaceNamedConstructor::trace, V8TestInterfaceNamedConstr
uctor::toActiveDOMObject, 0, V8TestInterfaceNamedConstructor::installConditional
lyEnabledMethods, V8TestInterfaceNamedConstructor::installConditionallyEnabledPr
operties, "TestInterfaceNamedConstructor", 0, WrapperTypeInfo::WrapperTypeObject
Prototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventT
arget, WrapperTypeInfo::Dependent, WrapperTypeInfo::RefCountedObject }; |
60 | 77 |
61 static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) | 78 static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
62 { | 79 { |
63 if (!info.IsConstructCall()) { | 80 if (!info.IsConstructCall()) { |
64 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("Audio")); | 81 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("Audio")); |
65 return; | 82 return; |
66 } | 83 } |
67 | 84 |
68 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { | 85 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { |
69 v8SetReturnValue(info, info.Holder()); | 86 v8SetReturnValue(info, info.Holder()); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 { | 208 { |
192 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->ref(); | 209 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->ref(); |
193 } | 210 } |
194 | 211 |
195 void V8TestInterfaceNamedConstructor::derefObject(ScriptWrappable* scriptWrappab
le) | 212 void V8TestInterfaceNamedConstructor::derefObject(ScriptWrappable* scriptWrappab
le) |
196 { | 213 { |
197 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->deref(); | 214 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->deref(); |
198 } | 215 } |
199 | 216 |
200 } // namespace blink | 217 } // namespace blink |
OLD | NEW |