| 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 "V8TestInterfaceEventConstructor.h" | 8 #include "V8TestInterfaceEventConstructor.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/Dictionary.h" | |
| 11 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| 11 #include "bindings/core/v8/PropertyBag.h" |
| 12 #include "bindings/core/v8/ScriptValue.h" | 12 #include "bindings/core/v8/ScriptValue.h" |
| 13 #include "bindings/core/v8/SerializedScriptValue.h" | 13 #include "bindings/core/v8/SerializedScriptValue.h" |
| 14 #include "bindings/core/v8/V8DOMConfiguration.h" | 14 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 15 #include "bindings/core/v8/V8HiddenValue.h" | 15 #include "bindings/core/v8/V8HiddenValue.h" |
| 16 #include "bindings/core/v8/V8ObjectConstructor.h" | 16 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 17 #include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" | 17 #include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" |
| 18 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" | 18 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" |
| 19 #include "core/dom/ContextFeatures.h" | 19 #include "core/dom/ContextFeatures.h" |
| 20 #include "core/dom/Document.h" | 20 #include "core/dom/Document.h" |
| 21 #include "core/frame/LocalDOMWindow.h" | 21 #include "core/frame/LocalDOMWindow.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceEventConstructor", info.Holder(), info.GetIsolate()); | 234 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceEventConstructor", info.Holder(), info.GetIsolate()); |
| 235 if (info.Length() < 1) { | 235 if (info.Length() < 1) { |
| 236 exceptionState.throwTypeError("An event name must be provided."); | 236 exceptionState.throwTypeError("An event name must be provided."); |
| 237 exceptionState.throwIfNeeded(); | 237 exceptionState.throwIfNeeded(); |
| 238 return; | 238 return; |
| 239 } | 239 } |
| 240 | 240 |
| 241 TOSTRING_VOID(V8StringResource<>, type, info[0]); | 241 TOSTRING_VOID(V8StringResource<>, type, info[0]); |
| 242 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute; | 242 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute; |
| 243 TestInterfaceEventConstructorInit eventInit; | 243 TestInterfaceEventConstructorInit eventInit; |
| 244 if (info.Length() >= 2) { | 244 if (info.Length() >= 2 && !info[1].IsEmpty() && info[1]->IsObject()) { |
| 245 TONATIVE_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate()
)); | 245 PropertyBag bag(info.GetIsolate(), info[1]->ToObject(), exceptionState); |
| 246 if (!initializeTestInterfaceEventConstructor(eventInit, options, excepti
onState, info)) { | 246 if (!initializeTestInterfaceEventConstructor(eventInit, bag, exceptionSt
ate, info)) { |
| 247 exceptionState.throwIfNeeded(); | 247 exceptionState.throwIfNeeded(); |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 options.get("initializedByEventConstructorReadonlyAnyAttribute", initial
izedByEventConstructorReadonlyAnyAttribute); | 250 if (bag.hasProperty("initializedByEventConstructorReadonlyAnyAttribute")
) { |
| 251 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty()) | 251 bag.convert("initializedByEventConstructorReadonlyAnyAttribute", ini
tializedByEventConstructorReadonlyAnyAttribute); |
| 252 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), v8At
omicString(info.GetIsolate(), "initializedByEventConstructorReadonlyAnyAttribute
"), initializedByEventConstructorReadonlyAnyAttribute); | 252 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), v8At
omicString(info.GetIsolate(), "initializedByEventConstructorReadonlyAnyAttribute
"), initializedByEventConstructorReadonlyAnyAttribute); |
| 253 } |
| 253 } | 254 } |
| 254 RefPtrWillBeRawPtr<TestInterfaceEventConstructor> event = TestInterfaceEvent
Constructor::create(type, eventInit, exceptionState); | 255 RefPtrWillBeRawPtr<TestInterfaceEventConstructor> event = TestInterfaceEvent
Constructor::create(type, eventInit, exceptionState); |
| 255 if (exceptionState.throwIfNeeded()) | 256 if (exceptionState.throwIfNeeded()) |
| 256 return; | 257 return; |
| 257 if (DOMWrapperWorld::current(info.GetIsolate()).isIsolatedWorld()) { | 258 if (DOMWrapperWorld::current(info.GetIsolate()).isIsolatedWorld()) { |
| 258 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty()) | 259 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty()) |
| 259 event->setSerializedInitializedByEventConstructorReadonlyAnyAttribut
e(SerializedScriptValue::createAndSwallowExceptions(initializedByEventConstructo
rReadonlyAnyAttribute, info.GetIsolate())); | 260 event->setSerializedInitializedByEventConstructorReadonlyAnyAttribut
e(SerializedScriptValue::createAndSwallowExceptions(initializedByEventConstructo
rReadonlyAnyAttribute, info.GetIsolate())); |
| 260 } | 261 } |
| 261 | 262 |
| 262 v8::Handle<v8::Object> wrapper = info.Holder(); | 263 v8::Handle<v8::Object> wrapper = info.Holder(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 274 {"initializedByEventConstructorReadonlyLongAttribute", TestInterfaceEventCon
structorV8Internal::initializedByEventConstructorReadonlyLongAttributeAttributeG
etterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V
8DOMConfiguration::OnInstance}, | 275 {"initializedByEventConstructorReadonlyLongAttribute", TestInterfaceEventCon
structorV8Internal::initializedByEventConstructorReadonlyLongAttributeAttributeG
etterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V
8DOMConfiguration::OnInstance}, |
| 275 {"initializedByEventConstructorReadonlyUint8ArrayAttribute", TestInterfaceEv
entConstructorV8Internal::initializedByEventConstructorReadonlyUint8ArrayAttribu
teAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAUL
T), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToA
llScripts, V8DOMConfiguration::OnInstance}, | 276 {"initializedByEventConstructorReadonlyUint8ArrayAttribute", TestInterfaceEv
entConstructorV8Internal::initializedByEventConstructorReadonlyUint8ArrayAttribu
teAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAUL
T), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToA
llScripts, V8DOMConfiguration::OnInstance}, |
| 276 {"initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute", TestInt
erfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTestInter
faceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessCon
trol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigura
tion::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 277 {"initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute", TestInt
erfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTestInter
faceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessCon
trol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigura
tion::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
| 277 {"initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttribute", Te
stInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTest
InterfaceEmptyArrayAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DO
MConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 278 {"initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttribute", Te
stInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTest
InterfaceEmptyArrayAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DO
MConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
| 278 {"initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute",
TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyN
ullableTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_ca
st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)
, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 279 {"initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute",
TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyN
ullableTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_ca
st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)
, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
| 279 {"deprecatedInitializedByEventConstructorReadonlyStringAttribute", TestInter
faceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyS
tringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 280 {"deprecatedInitializedByEventConstructorReadonlyStringAttribute", TestInter
faceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyS
tringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
| 280 {"implementedAsInitializedByEventConstructorReadonlyStringAttribute", TestIn
terfaceEventConstructorV8Internal::implementedAsInitializedByEventConstructorRea
donlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 281 {"implementedAsInitializedByEventConstructorReadonlyStringAttribute", TestIn
terfaceEventConstructorV8Internal::implementedAsInitializedByEventConstructorRea
donlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
| 281 {"deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribut
e", TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB
yEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8:
:None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}
, | 282 {"deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribut
e", TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB
yEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8:
:None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}
, |
| 282 }; | 283 }; |
| 283 | 284 |
| 284 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&
eventInit, const Dictionary& options, ExceptionState& exceptionState, const v8::
FunctionCallbackInfo<v8::Value>& info, const String& forEventName) | 285 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&
eventInit, const PropertyBag& bag, ExceptionState& exceptionState, const v8::Fun
ctionCallbackInfo<v8::Value>& info, const String& forEventName) |
| 285 { | 286 { |
| 286 Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? Str
ing("TestInterfaceEventConstructor") : forEventName, "", exceptionState); | 287 EventInitInitializer initializer(forEventName.isEmpty() ? String("TestInterf
aceEventConstructor") : forEventName, bag, exceptionState); |
| 287 if (!initializeEvent(eventInit, options, exceptionState, info, forEventName.
isEmpty() ? String("TestInterfaceEventConstructor") : forEventName)) | 288 if (!initializeEvent(eventInit, bag, exceptionState, info, forEventName.isEm
pty() ? String("TestInterfaceEventConstructor") : forEventName)) |
| 288 return false; | 289 return false; |
| 289 | 290 |
| 290 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"DOMString", false), "initializedByEventConstructorReadonlyStringAttribute", eve
ntInit.initializedByEventConstructorReadonlyStringAttribute)) | 291 if (!initializer.initializeProperty("initializedByEventConstructorReadonlySt
ringAttribute", eventInit.initializedByEventConstructorReadonlyStringAttribute,
"DOMString", PropertyBag::IsNotNullable)) |
| 291 return false; | 292 return false; |
| 292 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"boolean", false), "initializedByEventConstructorReadonlyBooleanAttribute", even
tInit.initializedByEventConstructorReadonlyBooleanAttribute)) | 293 if (!initializer.initializeProperty("initializedByEventConstructorReadonlyBo
oleanAttribute", eventInit.initializedByEventConstructorReadonlyBooleanAttribute
, "boolean", PropertyBag::IsNotNullable)) |
| 293 return false; | 294 return false; |
| 294 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"long", false), "initializedByEventConstructorReadonlyLongAttribute", eventInit.
initializedByEventConstructorReadonlyLongAttribute)) | 295 if (!initializer.initializeProperty("initializedByEventConstructorReadonlyLo
ngAttribute", eventInit.initializedByEventConstructorReadonlyLongAttribute, "lon
g", PropertyBag::IsNotNullable)) |
| 295 return false; | 296 return false; |
| 296 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"Uint8Array", false), "initializedByEventConstructorReadonlyUint8ArrayAttribute"
, eventInit.initializedByEventConstructorReadonlyUint8ArrayAttribute)) | 297 if (!initializer.initializeProperty("initializedByEventConstructorReadonlyUi
nt8ArrayAttribute", eventInit.initializedByEventConstructorReadonlyUint8ArrayAtt
ribute, "Uint8Array", PropertyBag::IsNotNullable)) |
| 297 return false; | 298 return false; |
| 298 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"TestInterfaceEmpty", false), "initializedByEventConstructorReadonlyTestInterfac
eEmptyAttribute", eventInit.initializedByEventConstructorReadonlyTestInterfaceEm
ptyAttribute)) | 299 if (!initializer.initializeProperty("initializedByEventConstructorReadonlyTe
stInterfaceEmptyAttribute", eventInit.initializedByEventConstructorReadonlyTestI
nterfaceEmptyAttribute, "TestInterfaceEmpty", PropertyBag::IsNotNullable)) |
| 299 return false; | 300 return false; |
| 300 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"TestInterfaceEmpty[]", false), "initializedByEventConstructorReadonlyTestInterf
aceEmptyArrayAttribute", eventInit.initializedByEventConstructorReadonlyTestInte
rfaceEmptyArrayAttribute)) | 301 if (!initializer.initializeProperty("initializedByEventConstructorReadonlyTe
stInterfaceEmptyArrayAttribute", eventInit.initializedByEventConstructorReadonly
TestInterfaceEmptyArrayAttribute, "TestInterfaceEmpty[]", PropertyBag::IsNotNull
able)) |
| 301 return false; | 302 return false; |
| 302 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"TestInterfaceEmpty", true), "initializedByEventConstructorReadonlyNullableTestI
nterfaceEmptyAttribute", eventInit.initializedByEventConstructorReadonlyNullable
TestInterfaceEmptyAttribute)) | 303 if (!initializer.initializeProperty("initializedByEventConstructorReadonlyNu
llableTestInterfaceEmptyAttribute", eventInit.initializedByEventConstructorReado
nlyNullableTestInterfaceEmptyAttribute, "TestInterfaceEmpty", PropertyBag::IsNul
lable)) |
| 303 return false; | 304 return false; |
| 304 if (DictionaryHelper::convert(options, conversionContext.setConversionType("
DOMString", false), "deprecatedInitializedByEventConstructorReadonlyStringAttrib
ute", eventInit.deprecatedInitializedByEventConstructorReadonlyStringAttribute))
{ | 305 if (initializer.initializeProperty("deprecatedInitializedByEventConstructorR
eadonlyStringAttribute", eventInit.deprecatedInitializedByEventConstructorReadon
lyStringAttribute, "DOMString", PropertyBag::IsNotNullable)) { |
| 305 if (options.hasProperty("deprecatedInitializedByEventConstructorReadonly
StringAttribute")) | 306 if (bag.hasProperty("deprecatedInitializedByEventConstructorReadonlyStri
ngAttribute")) |
| 306 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate
()), UseCounter::initializedByEventConstructorReadonlyStringAttribute); | 307 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate
()), UseCounter::initializedByEventConstructorReadonlyStringAttribute); |
| 307 } else { | 308 } else { |
| 308 return false; | 309 return false; |
| 309 } | 310 } |
| 310 if (!DictionaryHelper::convert(options, conversionContext.setConversionType(
"DOMString", false), "implementedAsInitializedByEventConstructorReadonlyStringAt
tribute", eventInit.implementedAsName)) | 311 if (!initializer.initializeProperty("implementedAsInitializedByEventConstruc
torReadonlyStringAttribute", eventInit.implementedAsName, "DOMString", PropertyB
ag::IsNotNullable)) |
| 311 return false; | 312 return false; |
| 312 if (DictionaryHelper::convert(options, conversionContext.setConversionType("
DOMString", false), "deprecatedImplementedAsInitializedByEventConstructorReadonl
yStringAttribute", eventInit.deprecatedImplementedAsName)) { | 313 if (initializer.initializeProperty("deprecatedImplementedAsInitializedByEven
tConstructorReadonlyStringAttribute", eventInit.deprecatedImplementedAsName, "DO
MString", PropertyBag::IsNotNullable)) { |
| 313 if (options.hasProperty("deprecatedImplementedAsInitializedByEventConstr
uctorReadonlyStringAttribute")) | 314 if (bag.hasProperty("deprecatedImplementedAsInitializedByEventConstructo
rReadonlyStringAttribute")) |
| 314 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate
()), UseCounter::initializedByEventConstructorReadonlyStringAttribute); | 315 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate
()), UseCounter::initializedByEventConstructorReadonlyStringAttribute); |
| 315 } else { | 316 } else { |
| 316 return false; | 317 return false; |
| 317 } | 318 } |
| 318 return true; | 319 return true; |
| 319 } | 320 } |
| 320 | 321 |
| 321 void V8TestInterfaceEventConstructor::constructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 322 void V8TestInterfaceEventConstructor::constructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 322 { | 323 { |
| 323 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); | 324 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 #endif | 399 #endif |
| 399 } | 400 } |
| 400 | 401 |
| 401 template<> | 402 template<> |
| 402 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) | 403 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) |
| 403 { | 404 { |
| 404 return toV8(impl, creationContext, isolate); | 405 return toV8(impl, creationContext, isolate); |
| 405 } | 406 } |
| 406 | 407 |
| 407 } // namespace blink | 408 } // namespace blink |
| OLD | NEW |