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 "V8TestInterfaceOwnProperties.h" | 8 #include "V8TestInterfaceOwnProperties.h" |
9 | 9 |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #pragma clang diagnostic pop | 30 #pragma clang diagnostic pop |
31 #endif | 31 #endif |
32 | 32 |
33 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eOwnProperties.h. | 33 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eOwnProperties.h. |
34 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 34 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
35 // bindings/core/v8/ScriptWrappable.h. | 35 // bindings/core/v8/ScriptWrappable.h. |
36 const WrapperTypeInfo& TestInterfaceOwnProperties::s_wrapperTypeInfo = V8TestInt
erfaceOwnProperties::wrapperTypeInfo; | 36 const WrapperTypeInfo& TestInterfaceOwnProperties::s_wrapperTypeInfo = V8TestInt
erfaceOwnProperties::wrapperTypeInfo; |
37 | 37 |
38 namespace TestInterfaceOwnPropertiesV8Internal { | 38 namespace TestInterfaceOwnPropertiesV8Internal { |
39 | 39 |
40 static void noExposeJSAccessorAttributeAttributeGetter(const v8::PropertyCallbac
kInfo<v8::Value>& info) | 40 static void noExposeJSAccessorAttributeAttributeGetter(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
41 { | 41 { |
42 v8::Local<v8::Object> holder = info.Holder(); | 42 v8::Local<v8::Object> holder = info.Holder(); |
43 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); | 43 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); |
44 v8SetReturnValueInt(info, impl->noExposeJSAccessorAttribute()); | 44 v8SetReturnValueInt(info, impl->noExposeJSAccessorAttribute()); |
45 } | 45 } |
46 | 46 |
47 static void noExposeJSAccessorAttributeAttributeGetterCallback(v8::Local<v8::Nam
e>, const v8::PropertyCallbackInfo<v8::Value>& info) | 47 static void noExposeJSAccessorAttributeAttributeGetterCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
48 { | 48 { |
49 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 49 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
50 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeGe
tter(info); | 50 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeGe
tter(info); |
51 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 51 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
52 } | 52 } |
53 | 53 |
54 static void noExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::PropertyCallbackInfo<void>& info) | 54 static void noExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::FunctionCallbackInfo<v8::Value>& info) |
55 { | 55 { |
56 v8::Local<v8::Object> holder = info.Holder(); | 56 v8::Local<v8::Object> holder = info.Holder(); |
57 ExceptionState exceptionState(ExceptionState::SetterContext, "noExposeJSAcce
ssorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate()); | 57 ExceptionState exceptionState(ExceptionState::SetterContext, "noExposeJSAcce
ssorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate()); |
58 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); | 58 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); |
59 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 59 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
60 if (exceptionState.throwIfNeeded()) | 60 if (exceptionState.throwIfNeeded()) |
61 return; | 61 return; |
62 impl->setNoExposeJSAccessorAttribute(cppValue); | 62 impl->setNoExposeJSAccessorAttribute(cppValue); |
63 } | 63 } |
64 | 64 |
65 static void noExposeJSAccessorAttributeAttributeSetterCallback(v8::Local<v8::Nam
e>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 65 static void noExposeJSAccessorAttributeAttributeSetterCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
66 { | 66 { |
| 67 v8::Local<v8::Value> v8Value = info[0]; |
67 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 68 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
68 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeSe
tter(v8Value, info); | 69 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeSe
tter(v8Value, info); |
69 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 70 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
70 } | 71 } |
71 | 72 |
72 static void exposeJSAccessorAttributeAttributeGetter(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 73 static void exposeJSAccessorAttributeAttributeGetter(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
73 { | 74 { |
74 v8::Local<v8::Object> holder = info.Holder(); | 75 v8::Local<v8::Object> holder = info.Holder(); |
75 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); | 76 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); |
76 v8SetReturnValueInt(info, impl->exposeJSAccessorAttribute()); | 77 v8SetReturnValueInt(info, impl->exposeJSAccessorAttribute()); |
(...skipping 18 matching lines...) Expand all Loading... |
95 } | 96 } |
96 | 97 |
97 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 98 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
98 { | 99 { |
99 v8::Local<v8::Value> v8Value = info[0]; | 100 v8::Local<v8::Value> v8Value = info[0]; |
100 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
101 TestInterfaceOwnPropertiesV8Internal::exposeJSAccessorAttributeAttributeSett
er(v8Value, info); | 102 TestInterfaceOwnPropertiesV8Internal::exposeJSAccessorAttributeAttributeSett
er(v8Value, info); |
102 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
103 } | 104 } |
104 | 105 |
105 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 106 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::FunctionCall
backInfo<v8::Value>& info) |
106 { | 107 { |
107 v8::Local<v8::Object> holder = info.Holder(); | 108 v8::Local<v8::Object> holder = info.Holder(); |
108 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); | 109 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); |
109 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute()); | 110 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute()); |
110 } | 111 } |
111 | 112 |
112 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(v8::Local<v8::
Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 113 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
113 { | 114 { |
114 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
115 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut
eGetter(info); | 116 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut
eGetter(info); |
116 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 117 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
117 } | 118 } |
118 | 119 |
119 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<void>& info) | 120 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v
8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
120 { | 121 { |
121 v8::Local<v8::Object> holder = info.Holder(); | 122 v8::Local<v8::Object> holder = info.Holder(); |
122 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA
ccessorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate()); | 123 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA
ccessorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate()); |
123 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); | 124 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold
er); |
124 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 125 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
125 if (exceptionState.throwIfNeeded()) | 126 if (exceptionState.throwIfNeeded()) |
126 return; | 127 return; |
127 impl->setDoNotExposeJSAccessorAttribute(cppValue); | 128 impl->setDoNotExposeJSAccessorAttribute(cppValue); |
128 } | 129 } |
129 | 130 |
130 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(v8::Local<v8::
Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 131 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
131 { | 132 { |
| 133 v8::Local<v8::Value> v8Value = info[0]; |
132 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 134 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
133 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut
eSetter(v8Value, info); | 135 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut
eSetter(v8Value, info); |
134 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 136 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
135 } | 137 } |
136 | 138 |
137 } // namespace TestInterfaceOwnPropertiesV8Internal | 139 } // namespace TestInterfaceOwnPropertiesV8Internal |
138 | 140 |
139 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial | |
140 // and does not depend on another global objects. | |
141 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
142 #pragma clang diagnostic push | |
143 #pragma clang diagnostic ignored "-Wglobal-constructors" | |
144 #endif | |
145 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceOwnProper
tiesAttributes[] = { | |
146 {"noExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::noExpo
seJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Intern
al::noExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DO
MConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfig
uration::CheckHolder}, | |
147 {"doNotExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::doN
otExposeJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8
Internal::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8
DOMConfiguration::CheckHolder}, | |
148 }; | |
149 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
150 #pragma clang diagnostic pop | |
151 #endif | |
152 | |
153 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceOwnPropert
iesAccessors[] = { | 141 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceOwnPropert
iesAccessors[] = { |
154 {"exposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::exposeJS
AccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Internal::
exposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acces
sControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfi
guration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfigurati
on::CheckHolder}, | 142 {"noExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::noExpo
seJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Intern
al::noExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, st
atic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScri
pts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, |
| 143 {"exposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::exposeJS
AccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Internal::
exposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_c
ast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V
8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 144 {"doNotExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::doN
otExposeJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8
Internal::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DE
FAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Exposed
ToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, |
155 }; | 145 }; |
156 | 146 |
157 static void installV8TestInterfaceOwnPropertiesTemplate(v8::Local<v8::FunctionTe
mplate> functionTemplate, v8::Isolate* isolate) | 147 static void installV8TestInterfaceOwnPropertiesTemplate(v8::Local<v8::FunctionTe
mplate> functionTemplate, v8::Isolate* isolate) |
158 { | 148 { |
159 functionTemplate->ReadOnlyPrototype(); | 149 functionTemplate->ReadOnlyPrototype(); |
160 | 150 |
161 v8::Local<v8::Signature> defaultSignature; | 151 v8::Local<v8::Signature> defaultSignature; |
162 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceOwnProperties", V8TestInterfaceEmpty::domTemplate(is
olate), V8TestInterfaceOwnProperties::internalFieldCount, | 152 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceOwnProperties", V8TestInterfaceEmpty::domTemplate(is
olate), V8TestInterfaceOwnProperties::internalFieldCount, |
163 V8TestInterfaceOwnPropertiesAttributes, WTF_ARRAY_LENGTH(V8TestInterface
OwnPropertiesAttributes), | 153 0, 0, |
164 V8TestInterfaceOwnPropertiesAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceO
wnPropertiesAccessors), | 154 V8TestInterfaceOwnPropertiesAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceO
wnPropertiesAccessors), |
165 0, 0); | 155 0, 0); |
166 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 156 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
167 ALLOW_UNUSED_LOCAL(instanceTemplate); | 157 ALLOW_UNUSED_LOCAL(instanceTemplate); |
168 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 158 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
169 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 159 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
170 | 160 |
171 // Custom toString template | 161 // Custom toString template |
172 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 162 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
173 } | 163 } |
(...skipping 22 matching lines...) Expand all Loading... |
196 { | 186 { |
197 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->ref(); | 187 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->ref(); |
198 } | 188 } |
199 | 189 |
200 void V8TestInterfaceOwnProperties::derefObject(ScriptWrappable* scriptWrappable) | 190 void V8TestInterfaceOwnProperties::derefObject(ScriptWrappable* scriptWrappable) |
201 { | 191 { |
202 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->deref(); | 192 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->deref(); |
203 } | 193 } |
204 | 194 |
205 } // namespace blink | 195 } // namespace blink |
OLD | NEW |