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

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

Issue 215993002: Clean up callback interface code and template (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/scripts/v8_callback_interface.py ('k') | no next file » | 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 {% if method.call_with_this_handle %} 44 {% if method.call_with_this_handle %}
45 v8::Handle<v8::Value> thisHandle = thisValue.v8Value(); 45 v8::Handle<v8::Value> thisHandle = thisValue.v8Value();
46 if (thisHandle.IsEmpty()) { 46 if (thisHandle.IsEmpty()) {
47 if (!isScriptControllerTerminating()) 47 if (!isScriptControllerTerminating())
48 CRASH(); 48 CRASH();
49 {{return_default}}; 49 {{return_default}};
50 } 50 }
51 ASSERT(thisHandle->IsObject()); 51 ASSERT(thisHandle->IsObject());
52 {% endif %} 52 {% endif %}
53 {% for argument in method.arguments %} 53 {% for argument in method.arguments %}
54 {{argument.cpp_to_v8_conversion | indent}} 54 v8::Handle<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value }};
55 if ({{argument.name}}Handle.IsEmpty()) { 55 if ({{argument.handle}}.IsEmpty()) {
56 if (!isScriptControllerTerminating()) 56 if (!isScriptControllerTerminating())
57 CRASH(); 57 CRASH();
58 {{return_default}}; 58 {{return_default}};
59 } 59 }
60 {% endfor %} 60 {% endfor %}
61 {% if method.arguments %} 61 {% if method.arguments %}
62 v8::Handle<v8::Value> argv[] = { {{method.handles | join(', ')}} }; 62 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', attribute=' handle')}} };
63 {% else %} 63 {% else %}
64 v8::Handle<v8::Value> *argv = 0; 64 v8::Handle<v8::Value> *argv = 0;
65 {% endif %} 65 {% endif %}
66 66
67 {% set this_handle_parameter = 'v8::Handle<v8::Object>::Cast(thisHandle), ' if method.call_with_this_handle else '' %} 67 {% set this_handle_parameter = 'v8::Handle<v8::Object>::Cast(thisHandle), ' if method.call_with_this_handle else '' %}
68 {% if method.idl_type == 'boolean' %} 68 {% if method.idl_type == 'boolean' %}
69 return invokeCallback(m_callback.newLocal(m_isolate), {{this_handle_paramete r}}{{method.arguments | length}}, argv, executionContext(), m_isolate); 69 return invokeCallback(m_callback.newLocal(m_isolate), {{this_handle_paramete r}}{{method.arguments | length}}, argv, executionContext(), m_isolate);
70 {% else %}{# void #} 70 {% else %}{# void #}
71 invokeCallback(m_callback.newLocal(m_isolate), {{this_handle_parameter}}{{me thod.arguments | length}}, argv, executionContext(), m_isolate); 71 invokeCallback(m_callback.newLocal(m_isolate), {{this_handle_parameter}}{{me thod.arguments | length}}, argv, executionContext(), m_isolate);
72 {% endif %} 72 {% endif %}
73 } 73 }
74 74
75 {% endfor %} 75 {% endfor %}
76 } // namespace WebCore 76 } // namespace WebCore
77 {% endfilter %} 77 {% endfilter %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_callback_interface.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698