OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // WARNING: Do not edit - generated code. | 5 // WARNING: Do not edit - generated code. |
6 | 6 |
7 #ifndef Dart$(INTERFACE)_h | 7 #ifndef Dart$(INTERFACE)_h |
8 #define Dart$(INTERFACE)_h | 8 #define Dart$(INTERFACE)_h |
9 | 9 |
10 #include "bindings/v8/ActiveDOMCallback.h" | 10 #include "bindings/v8/ActiveDOMCallback.h" |
11 #include "bindings/dart/DartCallback.h" | 11 #include "bindings/dart/DartCallback.h" |
12 #include "bindings/dart/DartDOMWrapper.h" | 12 #include "bindings/dart/DartDOMWrapper.h" |
13 #include "$(INTERFACE).h" | 13 #include "$(INTERFACE).h" |
14 | 14 |
15 namespace WebCore { | 15 namespace WebCore { |
16 | 16 |
17 class Dart$(INTERFACE) : public $(INTERFACE), public ActiveDOMCallback { | 17 class Dart$(INTERFACE) : public $(INTERFACE), public ActiveDOMCallback { |
18 public: | 18 public: |
19 typedef $(INTERFACE) NativeType; | 19 typedef Dart$(INTERFACE) NativeType; |
20 | 20 |
21 static PassRefPtr<NativeType> create(Dart_Handle object, Dart_Handle& except
ion) | 21 static PassOwnPtr<NativeType> create(Dart_Handle object, Dart_Handle& except
ion) |
22 { | 22 { |
23 return adoptRef(new Dart$(INTERFACE)(object, exception, DartUtilities::s
criptExecutionContext())); | 23 return adoptPtr(new Dart$(INTERFACE)(object, exception, DartUtilities::s
criptExecutionContext())); |
24 } | 24 } |
25 | 25 |
26 static PassRefPtr<NativeType> createWithNullCheck(Dart_Handle object, Dart_H
andle& exception) | 26 static PassOwnPtr<NativeType> createWithNullCheck(Dart_Handle object, Dart_H
andle& exception) |
27 { | 27 { |
28 if (Dart_IsNull(object)) | 28 if (Dart_IsNull(object)) |
29 return 0; | 29 return PassOwnPtr<NativeType>(); |
30 return create(object, exception); | 30 return create(object, exception); |
31 } | 31 } |
32 | 32 |
33 static PassRefPtr<NativeType> create(Dart_NativeArguments args, int idx, Dar
t_Handle& exception) | 33 static PassOwnPtr<NativeType> create(Dart_NativeArguments args, int idx, Dar
t_Handle& exception) |
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 PassRefPtr<NativeType> createWithNullCheck(Dart_NativeArguments args,
int idx, Dart_Handle& exception) | 39 static PassOwnPtr<NativeType> createWithNullCheck(Dart_NativeArguments args,
int idx, Dart_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 0; | 43 return PassOwnPtr<NativeType>(); |
44 return create(object, exception); | 44 return create(object, exception); |
45 } | 45 } |
46 | 46 |
47 $HANDLERS | 47 $HANDLERS |
48 | 48 |
49 private: | 49 private: |
50 Dart$(INTERFACE)(Dart_Handle object, Dart_Handle& exception, ExecutionContex
t* context) | 50 Dart$(INTERFACE)(Dart_Handle object, Dart_Handle& exception, ExecutionContex
t* context) |
51 : ActiveDOMCallback(context) | 51 : ActiveDOMCallback(context) |
52 , m_callback(object, exception) | 52 , m_callback(object, exception) |
53 { | 53 { |
54 } | 54 } |
55 | 55 |
56 DartCallback m_callback; | 56 DartCallback m_callback; |
57 }; | 57 }; |
58 | 58 |
59 } | 59 } |
60 | 60 |
61 #endif // Dart$(INTERFACE)_h | 61 #endif // Dart$(INTERFACE)_h |
OLD | NEW |