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

Unified Diff: Source/bindings/tests/results/core/V8TestObject.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterface.cpp ('k') | Source/core/dom/DOMDataView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/core/V8TestObject.cpp
diff --git a/Source/bindings/tests/results/core/V8TestObject.cpp b/Source/bindings/tests/results/core/V8TestObject.cpp
index f63c649fcbf15831d1062b5ff1a51f9c9b4a66dc..fcfc70de5c9dbb7944a719f81b46525e5ca9fa37 100644
--- a/Source/bindings/tests/results/core/V8TestObject.cpp
+++ b/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -12992,6 +12992,8 @@ bool V8TestObject::PrivateScript::voidMethodImplementedInPrivateScriptMethod(Loc
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
v8::Local<v8::Value> *argv = 0;
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate());
@@ -13018,6 +13020,8 @@ bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
v8::Local<v8::Value> *argv = 0;
ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethodImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate());
@@ -13048,6 +13052,8 @@ bool V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPriva
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
v8::Local<v8::Value> argv[] = { valueHandle };
@@ -13079,6 +13085,8 @@ bool V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPri
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
v8::Local<v8::Value> valueHandle = v8String(scriptState->isolate(), value);
v8::Local<v8::Value> argv[] = { valueHandle };
@@ -13110,6 +13118,8 @@ bool V8TestObject::PrivateScript::nodeMethodWithNodeArgumentImplementedInPrivate
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
v8::Local<v8::Value> valueHandle = toV8(value, scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> argv[] = { valueHandle };
@@ -13139,6 +13149,8 @@ bool V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPri
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
v8::Local<v8::Value> documentHandle = toV8(document, scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global(), scriptState->isolate());
@@ -13172,6 +13184,8 @@ bool V8TestObject::PrivateScript::methodForPrivateScriptOnlyMethod(LocalFrame* f
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1);
v8::Local<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate(), value2);
@@ -13204,6 +13218,8 @@ bool V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(LocalFra
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "readonlyShortAttribute", holder);
@@ -13233,6 +13249,8 @@ bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder);
@@ -13262,6 +13280,8 @@ bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate());
return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder, v8::Integer::New(scriptState->isolate(), cppValue));
@@ -13283,6 +13303,8 @@ bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder);
@@ -13312,6 +13334,8 @@ bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate());
return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder, v8String(scriptState->isolate(), cppValue));
@@ -13333,6 +13357,8 @@ bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder);
@@ -13360,6 +13386,8 @@ bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate());
return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState->isolate()));
@@ -13381,6 +13409,8 @@ bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPrivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly", holder);
@@ -13410,6 +13440,8 @@ bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPrivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->isolate());
return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppValue));
@@ -13431,6 +13463,8 @@ bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder);
@@ -13460,6 +13494,8 @@ bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+ if (holder.IsEmpty())
+ return false;
ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate());
return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->isolate(), cppValue));
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterface.cpp ('k') | Source/core/dom/DOMDataView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698