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

Side by Side Diff: Source/bindings/templates/callback_interface.cpp

Issue 330163004: Fix V8 callback binding for "CallWith=ThisValue" attribute. (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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestCallbackInterface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 {% filter conditional(conditional_string) %} 8 {% filter conditional(conditional_string) %}
9 #include "{{v8_class}}.h" 9 #include "{{v8_class}}.h"
10 10
(...skipping 27 matching lines...) Expand all
38 {{return_default}}; 38 {{return_default}};
39 39
40 ScriptState::Scope scope(m_scriptState.get()); 40 ScriptState::Scope scope(m_scriptState.get());
41 {% if method.call_with_this_handle %} 41 {% if method.call_with_this_handle %}
42 v8::Handle<v8::Value> thisHandle = thisValue.v8Value(); 42 v8::Handle<v8::Value> thisHandle = thisValue.v8Value();
43 if (thisHandle.IsEmpty()) { 43 if (thisHandle.IsEmpty()) {
44 if (!isScriptControllerTerminating()) 44 if (!isScriptControllerTerminating())
45 CRASH(); 45 CRASH();
46 {{return_default}}; 46 {{return_default}};
47 } 47 }
48 ASSERT(thisHandle->IsObject());
49 {% endif %} 48 {% endif %}
50 {% for argument in method.arguments %} 49 {% for argument in method.arguments %}
51 v8::Handle<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value }}; 50 v8::Handle<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value }};
52 if ({{argument.handle}}.IsEmpty()) { 51 if ({{argument.handle}}.IsEmpty()) {
53 if (!isScriptControllerTerminating()) 52 if (!isScriptControllerTerminating())
54 CRASH(); 53 CRASH();
55 {{return_default}}; 54 {{return_default}};
56 } 55 }
57 {% endfor %} 56 {% endfor %}
58 {% if method.arguments %} 57 {% if method.arguments %}
59 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} }; 58 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} };
60 {% else %} 59 {% else %}
61 v8::Handle<v8::Value> *argv = 0; 60 v8::Handle<v8::Value> *argv = 0;
62 {% endif %} 61 {% endif %}
63 62
64 {% set this_handle_parameter = 'v8::Handle<v8::Object>::Cast(thisHandle), ' if method.call_with_this_handle else '' %} 63 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl e else '' %}
haraken 2014/06/14 03:24:27 jsbell@ was saying that v8::Handle<v8::Value>::Cas
65 {% if method.idl_type == 'boolean' %} 64 {% if method.idl_type == 'boolean' %}
66 return invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{t his_handle_parameter}}{{method.arguments | length}}, argv); 65 return invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{t his_handle_parameter}}{{method.arguments | length}}, argv);
67 {% else %}{# void #} 66 {% else %}{# void #}
68 invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{this_han dle_parameter}}{{method.arguments | length}}, argv); 67 invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{this_han dle_parameter}}{{method.arguments | length}}, argv);
69 {% endif %} 68 {% endif %}
70 } 69 }
71 70
72 {% endfor %} 71 {% endfor %}
73 } // namespace WebCore 72 } // namespace WebCore
74 {% endfilter %} 73 {% endfilter %}
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestCallbackInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698