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

Unified Diff: Source/bindings/core/v8/PrivateScriptRunner.cpp

Issue 1061503005: bindings: Use Maybe version of Call() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/ScriptController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/PrivateScriptRunner.cpp
diff --git a/Source/bindings/core/v8/PrivateScriptRunner.cpp b/Source/bindings/core/v8/PrivateScriptRunner.cpp
index 3b7d0b9dd3b3a32577ab040cc733cf849608d0f6..4fd56461cf15a1db0d0a3347f98845fe52ddc62d 100644
--- a/Source/bindings/core/v8/PrivateScriptRunner.cpp
+++ b/Source/bindings/core/v8/PrivateScriptRunner.cpp
@@ -196,8 +196,8 @@ static void initializeHolderIfNeeded(ScriptState* scriptState, v8::Local<v8::Obj
v8::Local<v8::Value> initializeFunction;
if (classObject->Get(scriptState->context(), v8String(isolate, "initialize")).ToLocal(&initializeFunction) && initializeFunction->IsFunction()) {
v8::TryCatch block;
- V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(initializeFunction), scriptState->executionContext(), holder, 0, 0, isolate);
- if (block.HasCaught()) {
+ v8::Local<v8::Value> result;
+ if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(initializeFunction), scriptState->executionContext(), holder, 0, 0, isolate).ToLocal(&result)) {
fprintf(stderr, "Private script error: Object constructor threw an exception.\n");
dumpV8Message(context, block.Message());
RELEASE_ASSERT_NOT_REACHED();
@@ -305,8 +305,8 @@ v8::Local<v8::Value> PrivateScriptRunner::runDOMAttributeGetter(ScriptState* scr
}
initializeHolderIfNeeded(scriptState, classObject, holder);
v8::TryCatch block;
- v8::Local<v8::Value> result = V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(getter), scriptState->executionContext(), holder, 0, 0, isolate);
- if (block.HasCaught()) {
+ v8::Local<v8::Value> result;
+ if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(getter), scriptState->executionContext(), holder, 0, 0, isolate).ToLocal(&result)) {
rethrowExceptionInPrivateScript(isolate, block, scriptStateInUserScript, ExceptionState::GetterContext, attributeName, className);
block.ReThrow();
return v8::Local<v8::Value>();
@@ -331,8 +331,8 @@ bool PrivateScriptRunner::runDOMAttributeSetter(ScriptState* scriptState, Script
initializeHolderIfNeeded(scriptState, classObject, holder);
v8::Local<v8::Value> argv[] = { v8Value };
v8::TryCatch block;
- V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(setter), scriptState->executionContext(), holder, WTF_ARRAY_LENGTH(argv), argv, isolate);
- if (block.HasCaught()) {
+ v8::Local<v8::Value> result;
+ if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(setter), scriptState->executionContext(), holder, WTF_ARRAY_LENGTH(argv), argv, isolate).ToLocal(&result)) {
rethrowExceptionInPrivateScript(isolate, block, scriptStateInUserScript, ExceptionState::SetterContext, attributeName, className);
block.ReThrow();
return false;
@@ -350,8 +350,8 @@ v8::Local<v8::Value> PrivateScriptRunner::runDOMMethod(ScriptState* scriptState,
}
initializeHolderIfNeeded(scriptState, classObject, holder);
v8::TryCatch block;
- v8::Local<v8::Value> result = V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(method), scriptState->executionContext(), holder, argc, argv, scriptState->isolate());
- if (block.HasCaught()) {
+ v8::Local<v8::Value> result;
+ if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(method), scriptState->executionContext(), holder, argc, argv, scriptState->isolate()).ToLocal(&result)) {
rethrowExceptionInPrivateScript(scriptState->isolate(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, methodName, className);
block.ReThrow();
return v8::Local<v8::Value>();
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/ScriptController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698