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

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: rebase Created 5 years, 7 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 2441 matching lines...) Expand 10 before | Expand all | Expand 10 after
2452 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 2452 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
2453 if (contextInPrivateScript.IsEmpty()) 2453 if (contextInPrivateScript.IsEmpty())
2454 return false; 2454 return false;
2455 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 2455 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
2456 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 2456 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
2457 if (!scriptState->executionContext()) 2457 if (!scriptState->executionContext())
2458 return false; 2458 return false;
2459 2459
2460 ScriptState::Scope scope(scriptState); 2460 ScriptState::Scope scope(scriptState);
2461 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 2461 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
2462 if (holder.IsEmpty())
2463 return false;
2462 2464
2463 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); 2465 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
2464 v8::Local<v8::Value> argv[] = { valueHandle }; 2466 v8::Local<v8::Value> argv[] = { valueHandle };
2465 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr iptState->context()->Global(), scriptState->isolate()); 2467 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr iptState->context()->Global(), scriptState->isolate());
2466 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortA rgumentImplementedInPrivateScript", holder, 1, argv); 2468 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState , scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortA rgumentImplementedInPrivateScript", holder, 1, argv);
2467 if (v8Value.IsEmpty()) 2469 if (v8Value.IsEmpty())
2468 return false; 2470 return false;
2469 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState); 2471 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex ceptionState);
2470 if (exceptionState.throwIfNeeded()) 2472 if (exceptionState.throwIfNeeded())
2471 return false; 2473 return false;
(...skipping 11 matching lines...) Expand all
2483 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 2485 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
2484 if (contextInPrivateScript.IsEmpty()) 2486 if (contextInPrivateScript.IsEmpty())
2485 return false; 2487 return false;
2486 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 2488 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
2487 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 2489 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
2488 if (!scriptState->executionContext()) 2490 if (!scriptState->executionContext())
2489 return false; 2491 return false;
2490 2492
2491 ScriptState::Scope scope(scriptState); 2493 ScriptState::Scope scope(scriptState);
2492 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 2494 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
2495 if (holder.IsEmpty())
2496 return false;
2493 2497
2494 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate()); 2498 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
2495 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestInterfaceImplementation", "stringAttrib ute", holder); 2499 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc riptState, scriptStateInUserScript, "TestInterfaceImplementation", "stringAttrib ute", holder);
2496 if (v8Value.IsEmpty()) 2500 if (v8Value.IsEmpty())
2497 return false; 2501 return false;
2498 V8StringResource<> cppValue = v8Value; 2502 V8StringResource<> cppValue = v8Value;
2499 if (!cppValue.prepare()) 2503 if (!cppValue.prepare())
2500 return false; 2504 return false;
2501 RELEASE_ASSERT(!exceptionState.hadException()); 2505 RELEASE_ASSERT(!exceptionState.hadException());
2502 *result = cppValue; 2506 *result = cppValue;
2503 return true; 2507 return true;
2504 } 2508 }
2505 2509
2506 bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue) 2510 bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue)
2507 { 2511 {
2508 if (!frame) 2512 if (!frame)
2509 return false; 2513 return false;
2510 v8::HandleScope handleScope(toIsolate(frame)); 2514 v8::HandleScope handleScope(toIsolate(frame));
2511 ScriptForbiddenScope::AllowUserAgentScript script; 2515 ScriptForbiddenScope::AllowUserAgentScript script;
2512 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 2516 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
2513 if (contextInPrivateScript.IsEmpty()) 2517 if (contextInPrivateScript.IsEmpty())
2514 return false; 2518 return false;
2515 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 2519 ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
2516 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 2520 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
2517 if (!scriptState->executionContext()) 2521 if (!scriptState->executionContext())
2518 return false; 2522 return false;
2519 2523
2520 ScriptState::Scope scope(scriptState); 2524 ScriptState::Scope scope(scriptState);
2521 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 2525 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
2526 if (holder.IsEmpty())
2527 return false;
2522 2528
2523 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate()); 2529 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
2524 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestInterfaceImplementation", "stringAttribute", holder, v8String(s criptState->isolate(), cppValue)); 2530 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestInterfaceImplementation", "stringAttribute", holder, v8String(s criptState->isolate(), cppValue));
2525 } 2531 }
2526 2532
2527 InstallTemplateFunction V8TestInterface::installV8TestInterfaceTemplateFunction = (InstallTemplateFunction)&V8TestInterface::installV8TestInterfaceTemplate; 2533 InstallTemplateFunction V8TestInterface::installV8TestInterfaceTemplateFunction = (InstallTemplateFunction)&V8TestInterface::installV8TestInterfaceTemplate;
2528 2534
2529 void V8TestInterface::updateWrapperTypeInfo(InstallTemplateFunction installTempl ateFunction, PreparePrototypeObjectFunction preparePrototypeObjectFunction) 2535 void V8TestInterface::updateWrapperTypeInfo(InstallTemplateFunction installTempl ateFunction, PreparePrototypeObjectFunction preparePrototypeObjectFunction)
2530 { 2536 {
2531 V8TestInterface::installV8TestInterfaceTemplateFunction = installTemplateFun ction; 2537 V8TestInterface::installV8TestInterfaceTemplateFunction = installTemplateFun ction;
(...skipping 20 matching lines...) Expand all
2552 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2558 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&))
2553 { 2559 {
2554 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; 2560 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method;
2555 } 2561 }
2556 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2562 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
2557 { 2563 {
2558 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; 2564 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method;
2559 } 2565 }
2560 } // namespace blink 2566 } // namespace blink
2561 #endif // ENABLE(CONDITION) 2567 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698