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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased onto callback change Created 7 years, 3 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 62bd7ccd326fb044e049924c1c566d9d1d6a6195..441d5f0455c7f4a43996df7243bf9ded4043ca87 100644
--- a/Source/bindings/templates/callback_interface.cpp
+++ b/Source/bindings/templates/callback_interface.cpp
@@ -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_v8_conversion | indent}}
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(), isolate);
+{% set this_handle_parameter = 'v8::Handle<v8::Object>::Cast(thisHandle), ' if method.call_with_this_handle else '' %}
+ return !invokeCallback(m_callback.newLocal(isolate), {{this_handle_parameter}}{{method.arguments | length}}, argv, callbackReturnValue, scriptExecutionContext(), isolate);
}
{% endif %}

Powered by Google App Engine
This is Rietveld 408576698