OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium 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 #ifndef TONIC_DART_WRAPPABLE_H_ | 5 #ifndef TONIC_DART_WRAPPABLE_H_ |
6 #define TONIC_DART_WRAPPABLE_H_ | 6 #define TONIC_DART_WRAPPABLE_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/template_util.h" | 9 #include "base/template_util.h" |
10 #include "dart/runtime/include/dart_api.h" | 10 #include "mojo/public/third_party/dart/runtime/include/dart_api.h" |
11 #include "tonic/dart_converter.h" | 11 #include "tonic/dart_converter.h" |
12 #include "tonic/dart_error.h" | 12 #include "tonic/dart_error.h" |
13 #include "tonic/dart_state.h" | 13 #include "tonic/dart_state.h" |
14 #include "tonic/dart_wrapper_info.h" | 14 #include "tonic/dart_wrapper_info.h" |
15 | 15 |
16 namespace tonic { | 16 namespace tonic { |
17 class DartGCVisitor; | 17 class DartGCVisitor; |
18 struct DartWrapperInfo; | 18 struct DartWrapperInfo; |
19 | 19 |
20 // DartWrappable is a base class that you can inherit from in order to be | 20 // DartWrappable is a base class that you can inherit from in order to be |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 inline T* GetReceiver(Dart_NativeArguments args) { | 126 inline T* GetReceiver(Dart_NativeArguments args) { |
127 intptr_t receiver; | 127 intptr_t receiver; |
128 Dart_Handle result = Dart_GetNativeReceiver(args, &receiver); | 128 Dart_Handle result = Dart_GetNativeReceiver(args, &receiver); |
129 DCHECK(!Dart_IsError(result)); | 129 DCHECK(!Dart_IsError(result)); |
130 return static_cast<T*>(reinterpret_cast<DartWrappable*>(receiver)); | 130 return static_cast<T*>(reinterpret_cast<DartWrappable*>(receiver)); |
131 } | 131 } |
132 | 132 |
133 } // namespace tonic | 133 } // namespace tonic |
134 | 134 |
135 #endif // TONIC_DART_WRAPPABLE_H_ | 135 #endif // TONIC_DART_WRAPPABLE_H_ |
OLD | NEW |