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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More generator changes Created 7 years, 4 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.tmpl
diff --git a/Source/bindings/templates/callback_interface.cpp b/Source/bindings/templates/callback_interface.cpp.tmpl
similarity index 85%
rename from Source/bindings/templates/callback_interface.cpp
rename to Source/bindings/templates/callback_interface.cpp.tmpl
index 21a8969f9e0cbb249e993aca5cac66928f84a3ea..46c2a169466ee0b705f6862749e969e0bc8277b0 100644
--- a/Source/bindings/templates/callback_interface.cpp
+++ b/Source/bindings/templates/callback_interface.cpp.tmpl
@@ -68,6 +68,15 @@ namespace WebCore {
v8::Context::Scope scope(v8Context);
+{% if method.call_with_this_handle %}
+ v8::Handle<v8::Value> thisHandle = thisValue.v8Value();
+ if (thisHandle.IsEmpty()) {
+ if (!isScriptControllerTerminating())
+ CRASH();
+ return true;
+ }
+ ASSERT(thisHandle->IsObject());
+{% endif %}
{% for argument in method.arguments %}
{{argument.cpp_to_js_conversion | indent(4)}}
if ({{argument.name}}Handle.IsEmpty()) {
@@ -83,7 +92,8 @@ namespace WebCore {
{% endif %}
bool callbackReturnValue = false;
- return !invokeCallback(m_callback.newLocal(isolate), {{method.arguments | length}}, argv, callbackReturnValue, scriptExecutionContext());
+{% set this_handle_param = 'v8::Handle<v8::Object>::Cast(thisHandle), ' if method.call_with_this_handle else '' %}
haraken 2013/08/07 00:55:54 Nit: this_handle_param => this_handle_parameter (o
alancutter (OOO until 2018) 2013/08/07 01:12:48 Done. I chose this_handle_parameter because it inc
+ return !invokeCallback(m_callback.newLocal(isolate), {{this_handle_param}}{{method.arguments | length}}, argv, callbackReturnValue, scriptExecutionContext());
}
{% endif %}

Powered by Google App Engine
This is Rietveld 408576698