| 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 #if ENABLE(CONDITION) | 8 #if ENABLE(CONDITION) |
| 9 #include "V8TestInterfacePartial.h" | 9 #include "V8TestInterfacePartial.h" |
| 10 | 10 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); | 331 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); |
| 332 v8::Local<v8::Object> unscopeables; | 332 v8::Local<v8::Object> unscopeables; |
| 333 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymb
ol))) | 333 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymb
ol))) |
| 334 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLoca
lChecked().As<v8::Object>(); | 334 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLoca
lChecked().As<v8::Object>(); |
| 335 else | 335 else |
| 336 unscopeables = v8::Object::New(isolate); | 336 unscopeables = v8::Object::New(isolate); |
| 337 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "unscopeableVoidMe
thod"), v8::True(isolate)).FromJust(); | 337 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "unscopeableVoidMe
thod"), v8::True(isolate)).FromJust(); |
| 338 prototypeObject->ForceSet(v8Context, unscopablesSymbol, unscopeables).FromJu
st(); | 338 prototypeObject->ForceSet(v8Context, unscopablesSymbol, unscopeables).FromJu
st(); |
| 339 } | 339 } |
| 340 | 340 |
| 341 bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr
ivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int*
result) | |
| 342 { | |
| 343 if (!frame) | |
| 344 return false; | |
| 345 v8::HandleScope handleScope(toIsolate(frame)); | |
| 346 ScriptForbiddenScope::AllowUserAgentScript script; | |
| 347 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | |
| 348 if (contextInPrivateScript.IsEmpty()) | |
| 349 return false; | |
| 350 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | |
| 351 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | |
| 352 if (!scriptState->executionContext()) | |
| 353 return false; | |
| 354 | |
| 355 ScriptState::Scope scope(scriptState); | |
| 356 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | |
| 357 | |
| 358 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); | |
| 359 v8::Local<v8::Value> argv[] = { valueHandle }; | |
| 360 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr
iptState->context()->Global(), scriptState->isolate()); | |
| 361 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortA
rgumentImplementedInPrivateScript", holder, 1, argv); | |
| 362 if (v8Value.IsEmpty()) | |
| 363 return false; | |
| 364 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); | |
| 365 if (exceptionState.throwIfNeeded()) | |
| 366 return false; | |
| 367 *result = cppValue; | |
| 368 RELEASE_ASSERT(!exceptionState.hadException()); | |
| 369 return true; | |
| 370 } | |
| 371 | |
| 372 void V8TestInterfacePartial::initialize() | 341 void V8TestInterfacePartial::initialize() |
| 373 { | 342 { |
| 374 // Should be invoked from initModules. | 343 // Should be invoked from initModules. |
| 375 V8TestInterface::updateWrapperTypeInfo( | 344 V8TestInterface::updateWrapperTypeInfo( |
| 376 &V8TestInterfacePartial::installV8TestInterfaceTemplate, | 345 &V8TestInterfacePartial::installV8TestInterfaceTemplate, |
| 377 &V8TestInterfacePartial::preparePrototypeObject); | 346 &V8TestInterfacePartial::preparePrototypeObject); |
| 378 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface(
&TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod); | 347 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface(
&TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod); |
| 379 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte
rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver
loadMethod); | 348 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte
rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver
loadMethod); |
| 380 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa
ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe
thod); | 349 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa
ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe
thod); |
| 381 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI
nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti
alOverloadMethod); | 350 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI
nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti
alOverloadMethod); |
| 382 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn
terfaceImplementationPartialV8Internal::partial2VoidMethodMethod); | 351 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn
terfaceImplementationPartialV8Internal::partial2VoidMethodMethod); |
| 383 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(&
TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod); | 352 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(&
TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod); |
| 384 } | 353 } |
| 385 | 354 |
| 386 } // namespace blink | 355 } // namespace blink |
| 387 #endif // ENABLE(CONDITION) | 356 #endif // ENABLE(CONDITION) |
| OLD | NEW |