OLD | NEW |
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 20 matching lines...) Expand all Loading... |
31 {% set return_default = 'return true' | 31 {% set return_default = 'return true' |
32 if method.idl_type == 'boolean' else 'return' %}{# void #} | 32 if method.idl_type == 'boolean' else 'return' %}{# void #} |
33 if (!canInvokeCallback()) | 33 if (!canInvokeCallback()) |
34 {{return_default}}; | 34 {{return_default}}; |
35 | 35 |
36 if (!m_scriptState->contextIsValid()) | 36 if (!m_scriptState->contextIsValid()) |
37 {{return_default}}; | 37 {{return_default}}; |
38 | 38 |
39 ScriptState::Scope scope(m_scriptState.get()); | 39 ScriptState::Scope scope(m_scriptState.get()); |
40 {% if method.call_with_this_handle %} | 40 {% if method.call_with_this_handle %} |
41 v8::Handle<v8::Value> thisHandle = thisValue.v8Value(); | 41 v8::Local<v8::Value> thisHandle = thisValue.v8Value(); |
42 if (thisHandle.IsEmpty()) { | 42 if (thisHandle.IsEmpty()) { |
43 if (!isScriptControllerTerminating()) | 43 if (!isScriptControllerTerminating()) |
44 CRASH(); | 44 CRASH(); |
45 {{return_default}}; | 45 {{return_default}}; |
46 } | 46 } |
47 {% endif %} | 47 {% endif %} |
48 {% for argument in method.arguments %} | 48 {% for argument in method.arguments %} |
49 v8::Handle<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value
}}; | 49 v8::Local<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value}
}; |
50 if ({{argument.handle}}.IsEmpty()) { | 50 if ({{argument.handle}}.IsEmpty()) { |
51 if (!isScriptControllerTerminating()) | 51 if (!isScriptControllerTerminating()) |
52 CRASH(); | 52 CRASH(); |
53 {{return_default}}; | 53 {{return_default}}; |
54 } | 54 } |
55 {% endfor %} | 55 {% endfor %} |
56 {% if method.arguments %} | 56 {% if method.arguments %} |
57 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}}
}; | 57 v8::Local<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}}
}; |
58 {% else %} | 58 {% else %} |
59 {# Empty array initializers are illegal, and don't compile in MSVC. #} | 59 {# Empty array initializers are illegal, and don't compile in MSVC. #} |
60 v8::Handle<v8::Value> *argv = 0; | 60 v8::Local<v8::Value> *argv = 0; |
61 {% endif %} | 61 {% endif %} |
62 | 62 |
63 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl
e else 'm_scriptState->context()->Global(), ' %} | 63 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl
e else 'm_scriptState->context()->Global(), ' %} |
64 {% if method.idl_type == 'boolean' %} | 64 {% if method.idl_type == 'boolean' %} |
65 v8::TryCatch exceptionCatcher; | 65 v8::TryCatch exceptionCatcher; |
66 exceptionCatcher.SetVerbose(true); | 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()); | 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(); | 68 return !exceptionCatcher.HasCaught(); |
69 {% else %}{# void #} | 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()); | 70 ScriptController::callFunction(m_scriptState->executionContext(), m_callback
.newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments
| length}}, argv, m_scriptState->isolate()); |
71 {% endif %} | 71 {% endif %} |
72 } | 72 } |
73 | 73 |
74 {% endfor %} | 74 {% endfor %} |
75 } // namespace blink | 75 } // namespace blink |
76 {% endfilter %} | 76 {% endfilter %} |
OLD | NEW |