| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Dartium 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_dart}}. DO NOT MODIFY! |
| 6 |
| 7 #include "config.h" |
| 8 {% filter conditional(conditional_string) %} |
| 9 #include "{{dart_class}}.h" |
| 10 |
| 11 {% for filename in cpp_includes %} |
| 12 #include "{{filename}}" |
| 13 {% endfor %} |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 {% for method in methods if not method.custom %} |
| 18 {{method.cpp_type}} {{dart_class}}::{{method.name}}({{method.argument_declaratio
ns | join(', ')}}) |
| 19 { |
| 20 {% set return_default = 'return true' |
| 21 if method.idl_type == 'boolean' else 'return' %}{# void #} |
| 22 if (!m_callback.isIsolateAlive()) |
| 23 {{return_default}}; |
| 24 DartIsolateScope scope(m_callback.isolate()); |
| 25 DartApiScope apiScope; |
| 26 {% if method.call_with_this_handle %} |
| 27 // FIXME: we ignore thisValue which may or may not be correct for Dart. |
| 28 {% endif %} |
| 29 {% for argument in method.arguments %} |
| 30 Dart_Handle {{argument.handle}} = {{argument.cpp_value_to_dart_value}}; |
| 31 if (Dart_IsError({{argument.handle}})) { |
| 32 if (!isScriptControllerTerminating()) |
| 33 CRASH(); |
| 34 {{return_default}}; |
| 35 } |
| 36 {% endfor %} |
| 37 {% if method.arguments %} |
| 38 Dart_Handle arguments[] = { {{method.arguments | join(', ', attribute='handl
e')}} }; |
| 39 {% else %} |
| 40 Dart_Handle *arguments = 0; |
| 41 {% endif %} |
| 42 |
| 43 {% set return_with = 'return' |
| 44 if method.idl_type == 'boolean' else '' %}{# void #} |
| 45 {{return_with}} m_callback.handleEvent({{method.arguments | length}}, argume
nts); |
| 46 } |
| 47 |
| 48 {% endfor %} |
| 49 } // namespace blink |
| 50 {% endfilter %} |
| OLD | NEW |