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

Unified Diff: Source/bindings/templates/callback_interface.cpp

Issue 339063003: Add invokeCallback functionality to the code generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
Index: Source/bindings/templates/callback_interface.cpp
diff --git a/Source/bindings/templates/callback_interface.cpp b/Source/bindings/templates/callback_interface.cpp
index 1c0b347f78804d2215c7f9e33136ef3fc5747c77..ca24a21c10b8f7a5cebd287c1cf212b7769ea221 100644
--- a/Source/bindings/templates/callback_interface.cpp
+++ b/Source/bindings/templates/callback_interface.cpp
@@ -61,11 +61,14 @@ namespace WebCore {
v8::Handle<v8::Value> *argv = 0;
{% endif %}
- {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handle else '' %}
+ {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handle else 'm_scriptState->context()->Global(), ' %}
{% if method.idl_type == 'boolean' %}
- return invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{this_handle_parameter}}{{method.arguments | length}}, argv);
+ v8::TryCatch exceptionCatcher;
+ exceptionCatcher.SetVerbose(true);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate());
+ return !exceptionCatcher.HasCaught();
{% else %}{# void #}
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{this_handle_parameter}}{{method.arguments | length}}, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate());
{% endif %}
}
« no previous file with comments | « Source/bindings/scripts/v8_callback_interface.py ('k') | Source/bindings/tests/results/V8TestCallbackInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698