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

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

Issue 1301423004: bindings: Makes the default receiver of callbacks "undefined". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/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 {% include 'copyright_block.txt' %} 1 {% include 'copyright_block.txt' %}
2 #include "config.h" 2 #include "config.h"
3 {% filter conditional(conditional_string) %} 3 {% filter conditional(conditional_string) %}
4 #include "{{v8_class}}.h" 4 #include "{{v8_class}}.h"
5 5
6 {% for filename in cpp_includes %} 6 {% for filename in cpp_includes %}
7 #include "{{filename}}" 7 #include "{{filename}}"
8 {% endfor %} 8 {% endfor %}
9 9
10 namespace blink { 10 namespace blink {
(...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::Local<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} }; 58 v8::Local<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::Local<v8::Value> *argv = 0; 61 v8::Local<v8::Value> *argv = 0;
62 {% endif %} 62 {% endif %}
63 63
64 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl e else 'm_scriptState->context()->Global(), ' %} 64 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl e else 'v8::Undefined(m_scriptState->isolate()), ' %}
65 {% if method.idl_type == 'boolean' %} 65 {% if method.idl_type == 'boolean' %}
66 v8::TryCatch exceptionCatcher; 66 v8::TryCatch exceptionCatcher;
67 exceptionCatcher.SetVerbose(true); 67 exceptionCatcher.SetVerbose(true);
68 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate()); 68 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate());
69 return !exceptionCatcher.HasCaught(); 69 return !exceptionCatcher.HasCaught();
70 {% else %}{# void #} 70 {% else %}{# void #}
71 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate()); 71 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate());
72 {% endif %} 72 {% endif %}
73 } 73 }
74 74
75 {% endfor %} 75 {% endfor %}
76 } // namespace blink 76 } // namespace blink
77 {% endfilter %} 77 {% endfilter %}
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestCallbackInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698