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

Unified Diff: Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp

Issue 111603006: Simplify invokeCallback() and support void return values for IDL callbacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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/v8/V8Callback.cpp ('k') | Source/bindings/v8/custom/V8SQLTransactionCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
diff --git a/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
index 5a5aaf1ddad065321aab8c864509d57d23775c5d..fc597c110345da297a77e706a57a2381e2f72629 100644
--- a/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
+++ b/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
@@ -33,7 +33,7 @@
#include "V8SQLError.h"
#include "V8SQLTransaction.h"
-#include "bindings/v8/V8Callback.h"
+#include "bindings/v8/ScriptController.h"
#include "core/dom/ExecutionContext.h"
#include "wtf/Assertions.h"
@@ -66,12 +66,18 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr
errorHandle
};
- bool callbackReturnValue = false;
+ v8::TryCatch exceptionCatcher;
+ exceptionCatcher.SetVerbose(true);
+
+ v8::Handle<v8::Value> result = ScriptController::callFunction(executionContext(), m_callback.newLocal(isolate), isolate->GetCurrentContext()->Global(), 2, argv, isolate);
haraken 2013/12/11 00:54:30 I'm curious why you changed invokeCallback() to ca
adamk 2013/12/11 01:05:48 This allowed me to get rid of the callbackReturnVa
+
+ // FIXME: This comment doesn't make much sense given what the code is actually doing.
haraken 2013/12/11 00:54:30 Yeah, probably we can remove the comment.
adamk 2013/12/11 01:05:48 I'm going to leave it for posterity, I think; ther
+ //
// Step 6: If the error callback returns false, then move on to the next
// statement, if any, or onto the next overall step otherwise. Otherwise,
// the error callback did not return false, or there was no error callback.
// Jump to the last step in the overall steps.
- return invokeCallback(m_callback.newLocal(isolate), 2, argv, callbackReturnValue, executionContext(), isolate) || callbackReturnValue;
+ return exceptionCatcher.HasCaught() || (!result.IsEmpty() && result->BooleanValue());
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/V8Callback.cpp ('k') | Source/bindings/v8/custom/V8SQLTransactionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698