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

Side by Side Diff: sky/engine/bindings/templates/callback_interface.cpp

Issue 922053002: Remove unused V8 integration code in Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
6
7 #include "sky/engine/config.h"
8 {% filter conditional(conditional_string) %}
9 #include "{{v8_class}}.h"
10
11 {% for filename in cpp_includes %}
12 #include "{{filename}}"
13 {% endfor %}
14
15 namespace blink {
16
17 {{v8_class}}::{{v8_class}}(v8::Handle<v8::Function> callback, ScriptState* scrip tState)
18 : ActiveDOMCallback(scriptState->executionContext())
19 , m_scriptState(scriptState)
20 {
21 m_callback.set(scriptState->isolate(), callback);
22 }
23
24 {{v8_class}}::~{{v8_class}}()
25 {
26 }
27
28 {% for method in methods if not method.is_custom %}
29 {{method.cpp_type}} {{v8_class}}::{{method.name}}({{method.argument_declarations | join(', ')}})
30 {
31 {% set return_default = 'return true'
32 if method.idl_type == 'boolean' else 'return' %}{# void #}
33 if (!canInvokeCallback())
34 {{return_default}};
35
36 if (m_scriptState->contextIsEmpty())
37 {{return_default}};
38
39 ScriptState::Scope scope(m_scriptState.get());
40 {% if method.call_with_this_handle %}
41 v8::Handle<v8::Value> thisHandle = thisValue.v8Value();
42 if (thisHandle.IsEmpty()) {
43 if (!isScriptControllerTerminating())
44 CRASH();
45 {{return_default}};
46 }
47 {% endif %}
48 {% for argument in method.arguments %}
49 v8::Handle<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value }};
50 if ({{argument.handle}}.IsEmpty()) {
51 if (!isScriptControllerTerminating())
52 CRASH();
53 {{return_default}};
54 }
55 {% endfor %}
56 {% if method.arguments %}
57 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} };
58 {% else %}
59 {# Empty array initializers are illegal, and don't compile in MSVC. #}
60 v8::Handle<v8::Value> *argv = 0;
61 {% endif %}
62
63 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl e else 'm_scriptState->context()->Global(), ' %}
64 {% if method.idl_type == 'boolean' %}
65 v8::TryCatch exceptionCatcher;
66 exceptionCatcher.SetVerbose(true);
67 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate());
68 return !exceptionCatcher.HasCaught();
69 {% else %}{# void #}
70 ScriptController::callFunction(m_scriptState->executionContext(), m_callback .newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate());
71 {% endif %}
72 }
73
74 {% endfor %}
75 } // namespace blink
76 {% endfilter %}
OLDNEW
« no previous file with comments | « sky/engine/bindings/templates/callback_interface.h ('k') | sky/engine/bindings/templates/constants.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698