| 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 "V8TestInterfacePartial.h" | 7 #include "V8TestInterfacePartial.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/PrivateScriptRunner.h" | 10 #include "bindings/core/v8/PrivateScriptRunner.h" |
| 11 #include "bindings/core/v8/ScriptPromise.h" | 11 #include "bindings/core/v8/ScriptPromise.h" |
| 12 #include "bindings/core/v8/V8DOMConfiguration.h" | 12 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 13 #include "bindings/core/v8/V8Document.h" | 13 #include "bindings/core/v8/V8Document.h" |
| 14 #include "bindings/core/v8/V8Node.h" | 14 #include "bindings/core/v8/V8Node.h" |
| 15 #include "bindings/core/v8/V8ObjectConstructor.h" | 15 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 16 #include "bindings/core/v8/V8TestInterface.h" | 16 #include "bindings/core/v8/V8TestInterface.h" |
| 17 #include "bindings/tests/idls/modules/TestPartialInterfaceImplementation3.h" | 17 #include "bindings/tests/idls/modules/TestPartialInterfaceImplementation3.h" |
| 18 #include "core/dom/Document.h" | 18 #include "core/dom/Document.h" |
| 19 #include "core/frame/LocalFrame.h" | 19 #include "core/frame/LocalFrame.h" |
| 20 #include "core/inspector/ConsoleMessage.h" | |
| 21 #include "core/origin_trials/OriginTrials.h" | |
| 22 #include "platform/RuntimeEnabledFeatures.h" | 20 #include "platform/RuntimeEnabledFeatures.h" |
| 23 #include "platform/ScriptForbiddenScope.h" | 21 #include "platform/ScriptForbiddenScope.h" |
| 24 #include "wtf/GetPtr.h" | 22 #include "wtf/GetPtr.h" |
| 25 #include "wtf/RefPtr.h" | 23 #include "wtf/RefPtr.h" |
| 26 | 24 |
| 27 namespace blink { | 25 namespace blink { |
| 28 | 26 |
| 29 namespace TestInterfaceImplementationPartialV8Internal { | 27 namespace TestInterfaceImplementationPartialV8Internal { |
| 30 | 28 |
| 31 static void voidMethodPartialOverload3Method(const v8::FunctionCallbackInfo<v8::
Value>& info) | 29 static void voidMethodPartialOverload3Method(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 if (!isValidEnum(arg, validValues, WTF_ARRAY_LENGTH(validValues), "TestE
numModules", exceptionState)) { | 233 if (!isValidEnum(arg, validValues, WTF_ARRAY_LENGTH(validValues), "TestE
numModules", exceptionState)) { |
| 236 exceptionState.throwIfNeeded(); | 234 exceptionState.throwIfNeeded(); |
| 237 return; | 235 return; |
| 238 } | 236 } |
| 239 } | 237 } |
| 240 TestPartialInterfaceImplementation3::partialVoidTestEnumModulesArgMethod(*im
pl, arg); | 238 TestPartialInterfaceImplementation3::partialVoidTestEnumModulesArgMethod(*im
pl, arg); |
| 241 } | 239 } |
| 242 | 240 |
| 243 static void partialVoidTestEnumModulesArgMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 241 static void partialVoidTestEnumModulesArgMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
| 244 { | 242 { |
| 245 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | |
| 246 String errorMessage; | |
| 247 if (!OriginTrials::featureNameEnabled(executionContext, errorMessage)) { | |
| 248 v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); | |
| 249 if (!errorMessage.isEmpty()) { | |
| 250 toDocument(executionContext)->addConsoleMessage(ConsoleMessage::crea
te(JSMessageSource, ErrorMessageLevel, errorMessage)); | |
| 251 } | |
| 252 return; | |
| 253 } | |
| 254 TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgM
ethodMethod(info); | 243 TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgM
ethodMethod(info); |
| 255 } | 244 } |
| 256 | 245 |
| 257 static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 246 static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 258 { | 247 { |
| 259 V8StringResource<> value; | 248 V8StringResource<> value; |
| 260 { | 249 { |
| 261 value = info[0]; | 250 value = info[0]; |
| 262 if (!value.prepare()) | 251 if (!value.prepare()) |
| 263 return; | 252 return; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 286 } | 275 } |
| 287 | 276 |
| 288 static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 277 static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 289 { | 278 { |
| 290 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 279 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 291 TestPartialInterfaceImplementation3::unscopeableVoidMethod(*impl); | 280 TestPartialInterfaceImplementation3::unscopeableVoidMethod(*impl); |
| 292 } | 281 } |
| 293 | 282 |
| 294 static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 283 static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 295 { | 284 { |
| 296 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | |
| 297 String errorMessage; | |
| 298 if (!OriginTrials::featureNameEnabled(executionContext, errorMessage)) { | |
| 299 v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); | |
| 300 if (!errorMessage.isEmpty()) { | |
| 301 toDocument(executionContext)->addConsoleMessage(ConsoleMessage::crea
te(JSMessageSource, ErrorMessageLevel, errorMessage)); | |
| 302 } | |
| 303 return; | |
| 304 } | |
| 305 TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(in
fo); | 285 TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(in
fo); |
| 306 } | 286 } |
| 307 | 287 |
| 308 } // namespace TestInterfaceImplementationPartialV8Internal | 288 } // namespace TestInterfaceImplementationPartialV8Internal |
| 309 | 289 |
| 310 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] = { | 290 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] = { |
| 311 {"partialVoidTestEnumModulesArgMethod", TestInterfaceImplementationPartialV8
Internal::partialVoidTestEnumModulesArgMethodMethodCallback, 0, 1, v8::None, V8D
OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 291 {"partialVoidTestEnumModulesArgMethod", TestInterfaceImplementationPartialV8
Internal::partialVoidTestEnumModulesArgMethodMethodCallback, 0, 1, v8::None, V8D
OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 312 {"unscopeableVoidMethod", TestInterfaceImplementationPartialV8Internal::unsc
opeableVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAl
lScripts, V8DOMConfiguration::OnPrototype}, | 292 {"unscopeableVoidMethod", TestInterfaceImplementationPartialV8Internal::unsc
opeableVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAl
lScripts, V8DOMConfiguration::OnPrototype}, |
| 313 }; | 293 }; |
| 314 | 294 |
| 315 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi
onTemplate> interfaceTemplate, v8::Isolate* isolate) | 295 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi
onTemplate> interfaceTemplate, v8::Isolate* isolate) |
| 316 { | 296 { |
| 317 // Initialize the interface object's template. | 297 // Initialize the interface object's template. |
| 318 V8TestInterface::installV8TestInterfaceTemplate(interfaceTemplate, isolate); | 298 V8TestInterface::installV8TestInterfaceTemplate(interfaceTemplate, isolate); |
| 319 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 299 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); |
| 320 ALLOW_UNUSED_LOCAL(signature); | 300 ALLOW_UNUSED_LOCAL(signature); |
| 321 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); | 301 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); |
| 322 ALLOW_UNUSED_LOCAL(instanceTemplate); | 302 ALLOW_UNUSED_LOCAL(instanceTemplate); |
| 323 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); | 303 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); |
| 324 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 304 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 325 // Register DOM constants, attributes and operations. | 305 // Register DOM constants, attributes and operations. |
| 326 const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants[] =
{ | 306 if (RuntimeEnabledFeatures::featureNameEnabled()) { |
| 327 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, V8DOMConfiguration::ConstantTypeUnsign
edShort}, | 307 const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants
[] = { |
| 328 }; | 308 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, V8DOMConfiguration::ConstantTypeUn
signedShort}, |
| 329 V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototypeTe
mplate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants)); | 309 }; |
| 330 V8DOMConfiguration::installMethods(isolate, instanceTemplate, prototypeTempl
ate, interfaceTemplate, signature, V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8Te
stInterfaceMethods)); | 310 V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototy
peTemplate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants)
); |
| 311 V8DOMConfiguration::installMethods(isolate, instanceTemplate, prototypeT
emplate, interfaceTemplate, signature, V8TestInterfaceMethods, WTF_ARRAY_LENGTH(
V8TestInterfaceMethods)); |
| 312 } // if (RuntimeEnabledFeatures::featureNameEnabled()) |
| 331 | 313 |
| 332 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface::legacyCallCustom
); | 314 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface::legacyCallCustom
); |
| 333 } | 315 } |
| 334 | 316 |
| 335 void V8TestInterfacePartial::preparePrototypeAndInterfaceObject(v8::Local<v8::Co
ntext> context, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> i
nterfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) | 317 void V8TestInterfacePartial::preparePrototypeAndInterfaceObject(v8::Local<v8::Co
ntext> context, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> i
nterfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) |
| 336 { | 318 { |
| 337 V8TestInterface::preparePrototypeAndInterfaceObject(context, prototypeObject
, interfaceObject, interfaceTemplate); | 319 V8TestInterface::preparePrototypeAndInterfaceObject(context, prototypeObject
, interfaceObject, interfaceTemplate); |
| 338 v8::Isolate* isolate = context->GetIsolate(); | 320 v8::Isolate* isolate = context->GetIsolate(); |
| 339 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); | 321 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); |
| 340 v8::Local<v8::Object> unscopeables; | 322 v8::Local<v8::Object> unscopeables; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 354 &V8TestInterfacePartial::preparePrototypeAndInterfaceObject); | 336 &V8TestInterfacePartial::preparePrototypeAndInterfaceObject); |
| 355 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface(
&TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod); | 337 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface(
&TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod); |
| 356 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte
rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver
loadMethod); | 338 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte
rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver
loadMethod); |
| 357 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa
ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe
thod); | 339 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa
ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe
thod); |
| 358 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI
nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti
alOverloadMethod); | 340 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI
nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti
alOverloadMethod); |
| 359 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn
terfaceImplementationPartialV8Internal::partial2VoidMethodMethod); | 341 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn
terfaceImplementationPartialV8Internal::partial2VoidMethodMethod); |
| 360 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(&
TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod); | 342 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(&
TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod); |
| 361 } | 343 } |
| 362 | 344 |
| 363 } // namespace blink | 345 } // namespace blink |
| OLD | NEW |