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