Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterface.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 2427 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
2428 if (contextInPrivateScript.IsEmpty()) 2428 if (contextInPrivateScript.IsEmpty())
2429 return false; 2429 return false;
2430 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 2430 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
2431 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 2431 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
2432 if (!scriptState->executionContext()) 2432 if (!scriptState->executionContext())
2433 return false; 2433 return false;
2434 2434
2435 ScriptState::Scope scope(scriptState); 2435 ScriptState::Scope scope(scriptState);
2436 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 2436 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
2437 if (holder.IsEmpty())
2438 return false;
2437 2439
2438 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); 2440 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
2439 v8::Local<v8::Value> argv[] = { valueHandle }; 2441 v8::Local<v8::Value> argv[] = { valueHandle };
2440 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr iptState->context()->Global(), scriptState->isolate()); 2442 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr iptState->context()->Global(), scriptState->isolate());
2441 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortA rgumentImplementedInPrivateScript", holder, 1, argv); 2443 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortA rgumentImplementedInPrivateScript", holder, 1, argv);
2442 if (v8Value.IsEmpty()) 2444 if (v8Value.IsEmpty())
2443 return false; 2445 return false;
2444 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState); 2446 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState);
2445 if (exceptionState.throwIfNeeded()) 2447 if (exceptionState.throwIfNeeded())
2446 return false; 2448 return false;
(...skipping 11 matching lines...) Expand all
2458 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 2460 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
2459 if (contextInPrivateScript.IsEmpty()) 2461 if (contextInPrivateScript.IsEmpty())
2460 return false; 2462 return false;
2461 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 2463 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
2462 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 2464 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
2463 if (!scriptState->executionContext()) 2465 if (!scriptState->executionContext())
2464 return false; 2466 return false;
2465 2467
2466 ScriptState::Scope scope(scriptState); 2468 ScriptState::Scope scope(scriptState);
2467 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 2469 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
2470 if (holder.IsEmpty())
2471 return false;
2468 2472
2469 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate()); 2473 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
2470 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestInterfaceImplementation", "stringAttrib ute", holder); 2474 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestInterfaceImplementation", "stringAttrib ute", holder);
2471 if (v8Value.IsEmpty()) 2475 if (v8Value.IsEmpty())
2472 return false; 2476 return false;
2473 V8StringResource<> cppValue = v8Value; 2477 V8StringResource<> cppValue = v8Value;
2474 if (!cppValue.prepare()) 2478 if (!cppValue.prepare())
2475 return false; 2479 return false;
2476 RELEASE_ASSERT(!exceptionState.hadException()); 2480 RELEASE_ASSERT(!exceptionState.hadException());
2477 *result = cppValue; 2481 *result = cppValue;
2478 return true; 2482 return true;
2479 } 2483 }
2480 2484
2481 bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue) 2485 bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue)
2482 { 2486 {
2483 if (!frame) 2487 if (!frame)
2484 return false; 2488 return false;
2485 v8::HandleScope handleScope(toIsolate(frame)); 2489 v8::HandleScope handleScope(toIsolate(frame));
2486 ScriptForbiddenScope::AllowUserAgentScript script; 2490 ScriptForbiddenScope::AllowUserAgentScript script;
2487 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 2491 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
2488 if (contextInPrivateScript.IsEmpty()) 2492 if (contextInPrivateScript.IsEmpty())
2489 return false; 2493 return false;
2490 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 2494 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
2491 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 2495 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
2492 if (!scriptState->executionContext()) 2496 if (!scriptState->executionContext())
2493 return false; 2497 return false;
2494 2498
2495 ScriptState::Scope scope(scriptState); 2499 ScriptState::Scope scope(scriptState);
2496 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 2500 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
2501 if (holder.IsEmpty())
2502 return false;
2497 2503
2498 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate()); 2504 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
2499 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestInterfaceImplementation", "stringAttribute", holder, v8String(s criptState->isolate(), cppValue)); 2505 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestInterfaceImplementation", "stringAttribute", holder, v8String(s criptState->isolate(), cppValue));
2500 } 2506 }
2501 2507
2502 InstallTemplateFunction V8TestInterface::installV8TestInterfaceTemplateFunction = (InstallTemplateFunction)&V8TestInterface::installV8TestInterfaceTemplate; 2508 InstallTemplateFunction V8TestInterface::installV8TestInterfaceTemplateFunction = (InstallTemplateFunction)&V8TestInterface::installV8TestInterfaceTemplate;
2503 2509
2504 void V8TestInterface::updateWrapperTypeInfo(InstallTemplateFunction installTempl ateFunction, PreparePrototypeObjectFunction preparePrototypeObjectFunction) 2510 void V8TestInterface::updateWrapperTypeInfo(InstallTemplateFunction installTempl ateFunction, PreparePrototypeObjectFunction preparePrototypeObjectFunction)
2505 { 2511 {
2506 V8TestInterface::installV8TestInterfaceTemplateFunction = installTemplateFun ction; 2512 V8TestInterface::installV8TestInterfaceTemplateFunction = installTemplateFun ction;
(...skipping 20 matching lines...) Expand all
2527 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2533 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&))
2528 { 2534 {
2529 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; 2535 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method;
2530 } 2536 }
2531 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2537 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
2532 { 2538 {
2533 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; 2539 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method;
2534 } 2540 }
2535 } // namespace blink 2541 } // namespace blink
2536 #endif // ENABLE(CONDITION) 2542 #endif // ENABLE(CONDITION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698