| 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 #ifndef {{dart_class}}_h | |
| 8 #define {{dart_class}}_h | |
| 9 | |
| 10 {% filter conditional(conditional_string) %} | |
| 11 {% for filename in header_includes %} | |
| 12 #include "{{filename}}" | |
| 13 {% endfor %} | |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 class {{dart_class}} : public {{cpp_class}}, public ActiveDOMCallback { | |
| 18 public: | |
| 19 typedef {{dart_class}} NativeType; | |
| 20 | |
| 21 static PassOwnPtr<NativeType> create(Dart_Handle object, Dart_Handle& except
ion) | |
| 22 { | |
| 23 return adoptPtr(new {{dart_class}}(object, exception, DartUtilities::scr
iptExecutionContext())); | |
| 24 } | |
| 25 | |
| 26 static PassOwnPtr<NativeType> createWithNullCheck(Dart_Handle object, Dart_H
andle& exception) | |
| 27 { | |
| 28 if (Dart_IsNull(object)) | |
| 29 return PassOwnPtr<NativeType>(); | |
| 30 return create(object, exception); | |
| 31 } | |
| 32 | |
| 33 static PassOwnPtr<NativeType> create(Dart_NativeArguments args, int idx, Dar
t_Handle& exception) | |
| 34 { | |
| 35 Dart_Handle object = Dart_GetNativeArgument(args, idx); | |
| 36 return create(object, exception); | |
| 37 } | |
| 38 | |
| 39 static PassOwnPtr<NativeType> createWithNullCheck(Dart_NativeArguments args,
int idx, Dart_Handle& exception) | |
| 40 { | |
| 41 Dart_Handle object = Dart_GetNativeArgument(args, idx); | |
| 42 if (Dart_IsNull(object)) | |
| 43 return PassOwnPtr<NativeType>(); | |
| 44 return create(object, exception); | |
| 45 } | |
| 46 | |
| 47 {% for method in methods %} | |
| 48 virtual {{method.cpp_type}} {{method.name}}({{method.argument_declarations |
join(', ')}}) OVERRIDE; | |
| 49 {% endfor %} | |
| 50 private: | |
| 51 {{dart_class}}(Dart_Handle object, Dart_Handle& exception, ExecutionContext*
context) | |
| 52 : ActiveDOMCallback(context) | |
| 53 , m_callback(object, exception) | |
| 54 { | |
| 55 } | |
| 56 | |
| 57 DartCallback m_callback; | |
| 58 }; | |
| 59 | |
| 60 } | |
| 61 {% endfilter %} | |
| 62 #endif // {{dart_class}}_h | |
| OLD | NEW |