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_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) %} |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 exception = Dart_NewStringFromCString("Null value is not a valid {{dart_
class}}"); | 84 exception = Dart_NewStringFromCString("Null value is not a valid {{dart_
class}}"); |
85 return 0; | 85 return 0; |
86 } | 86 } |
87 | 87 |
88 // Convert nullable to native, Dart_Null maps to C++ null | 88 // Convert nullable to native, Dart_Null maps to C++ null |
89 static NativeType* toNativeWithNullCheck(Dart_NativeArguments args, int inde
x, Dart_Handle& exception) | 89 static NativeType* toNativeWithNullCheck(Dart_NativeArguments args, int inde
x, Dart_Handle& exception) |
90 { | 90 { |
91 return DartDOMWrapper::unwrapDartWrapper<{{dart_class}}>(args, index, ex
ception); | 91 return DartDOMWrapper::unwrapDartWrapper<{{dart_class}}>(args, index, ex
ception); |
92 } | 92 } |
93 | 93 |
| 94 static bool hasInstance(Dart_Handle wrapper) |
| 95 { |
| 96 return DartDOMWrapper::subtypeOf(wrapper, dartClassId); |
| 97 } |
| 98 |
94 static Dart_Handle toDart(NativeType* value) | 99 static Dart_Handle toDart(NativeType* value) |
95 { | 100 { |
96 if (!value) | 101 if (!value) |
97 return Dart_Null(); | 102 return Dart_Null(); |
98 DartDOMData* domData = DartDOMData::current(); | 103 DartDOMData* domData = DartDOMData::current(); |
99 Dart_WeakPersistentHandle result = | 104 Dart_WeakPersistentHandle result = |
100 DartDOMWrapper::lookupWrapper<{{dart_class}}>(domData, value); | 105 DartDOMWrapper::lookupWrapper<{{dart_class}}>(domData, value); |
101 if (result) | 106 if (result) |
102 return Dart_HandleFromWeakPersistent(result); | 107 return Dart_HandleFromWeakPersistent(result); |
103 return createWrapper(domData, value); | 108 return createWrapper(domData, value); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void propertyQuery(Dart_NativeArguments args); | 193 void propertyQuery(Dart_NativeArguments args); |
189 {% endif %} | 194 {% endif %} |
190 | 195 |
191 } | 196 } |
192 | 197 |
193 } // namespace blink | 198 } // namespace blink |
194 | 199 |
195 {% endfilter %} | 200 {% endfilter %} |
196 | 201 |
197 #endif // {{dart_class}}_h | 202 #endif // {{dart_class}}_h |
OLD | NEW |