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

Side by Side 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 unified diff | Download patch
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 {{return_default}}; 54 {{return_default}};
55 } 55 }
56 {% endfor %} 56 {% endfor %}
57 {% if method.arguments %} 57 {% if method.arguments %}
58 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} }; 58 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} };
59 {% else %} 59 {% else %}
60 {# Empty array initializers are illegal, and don't compile in MSVC. #} 60 {# Empty array initializers are illegal, and don't compile in MSVC. #}
61 v8::Handle<v8::Value> *argv = 0; 61 v8::Handle<v8::Value> *argv = 0;
62 {% endif %} 62 {% endif %}
63 63
64 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl e else '' %} 64 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl e else 'm_scriptState->context()->Global(), ' %}
65 {% if method.idl_type == 'boolean' %} 65 {% if method.idl_type == 'boolean' %}
66 return invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{t his_handle_parameter}}{{method.arguments | length}}, argv); 66 v8::TryCatch exceptionCatcher;
67 exceptionCatcher.SetVerbose(true);
68 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(isolate), {{this_handle_parameter}}{{method.arguments | length}}, argv , m_scriptState->isolate());
69 return !exceptionCatcher.HasCaught();
67 {% else %}{# void #} 70 {% else %}{# void #}
68 invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{this_han dle_parameter}}{{method.arguments | length}}, argv); 71 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(isolate), {{this_handle_parameter}}{{method.arguments | length}}, argv , m_scriptState->isolate());
69 {% endif %} 72 {% endif %}
70 } 73 }
71 74
72 {% endfor %} 75 {% endfor %}
73 } // namespace WebCore 76 } // namespace WebCore
74 {% endfilter %} 77 {% endfilter %}
OLDNEW
« 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