Chromium Code Reviews| 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 27 matching lines...) Expand all Loading... | |
| 38 {{return_default}}; | 38 {{return_default}}; |
| 39 | 39 |
| 40 ScriptState::Scope scope(m_scriptState.get()); | 40 ScriptState::Scope scope(m_scriptState.get()); |
| 41 {% if method.call_with_this_handle %} | 41 {% if method.call_with_this_handle %} |
| 42 v8::Handle<v8::Value> thisHandle = thisValue.v8Value(); | 42 v8::Handle<v8::Value> thisHandle = thisValue.v8Value(); |
| 43 if (thisHandle.IsEmpty()) { | 43 if (thisHandle.IsEmpty()) { |
| 44 if (!isScriptControllerTerminating()) | 44 if (!isScriptControllerTerminating()) |
| 45 CRASH(); | 45 CRASH(); |
| 46 {{return_default}}; | 46 {{return_default}}; |
| 47 } | 47 } |
| 48 ASSERT(thisHandle->IsObject()); | |
| 49 {% endif %} | 48 {% endif %} |
| 50 {% for argument in method.arguments %} | 49 {% for argument in method.arguments %} |
| 51 v8::Handle<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value }}; | 50 v8::Handle<v8::Value> {{argument.handle}} = {{argument.cpp_value_to_v8_value }}; |
| 52 if ({{argument.handle}}.IsEmpty()) { | 51 if ({{argument.handle}}.IsEmpty()) { |
| 53 if (!isScriptControllerTerminating()) | 52 if (!isScriptControllerTerminating()) |
| 54 CRASH(); | 53 CRASH(); |
| 55 {{return_default}}; | 54 {{return_default}}; |
| 56 } | 55 } |
| 57 {% endfor %} | 56 {% endfor %} |
| 58 {% if method.arguments %} | 57 {% if method.arguments %} |
| 59 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} }; | 58 v8::Handle<v8::Value> argv[] = { {{method.arguments | join(', ', 'handle')}} }; |
| 60 {% else %} | 59 {% else %} |
| 61 v8::Handle<v8::Value> *argv = 0; | 60 v8::Handle<v8::Value> *argv = 0; |
| 62 {% endif %} | 61 {% endif %} |
| 63 | 62 |
| 64 {% set this_handle_parameter = 'v8::Handle<v8::Object>::Cast(thisHandle), ' if method.call_with_this_handle else '' %} | 63 {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handl e else '' %} |
|
haraken
2014/06/14 03:24:27
jsbell@ was saying that v8::Handle<v8::Value>::Cas
| |
| 65 {% if method.idl_type == 'boolean' %} | 64 {% if method.idl_type == 'boolean' %} |
| 66 return invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{t his_handle_parameter}}{{method.arguments | length}}, argv); | 65 return invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{t his_handle_parameter}}{{method.arguments | length}}, argv); |
| 67 {% else %}{# void #} | 66 {% else %}{# void #} |
| 68 invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{this_han dle_parameter}}{{method.arguments | length}}, argv); | 67 invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), {{this_han dle_parameter}}{{method.arguments | length}}, argv); |
| 69 {% endif %} | 68 {% endif %} |
| 70 } | 69 } |
| 71 | 70 |
| 72 {% endfor %} | 71 {% endfor %} |
| 73 } // namespace WebCore | 72 } // namespace WebCore |
| 74 {% endfilter %} | 73 {% endfilter %} |
| OLD | NEW |