| 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 #include "tonic/dart_wrappable.h" | 5 #include "tonic/dart_wrappable.h" |
| 6 | 6 |
| 7 #include "tonic/dart_class_library.h" | 7 #include "tonic/dart_class_library.h" |
| 8 #include "tonic/dart_error.h" | 8 #include "tonic/dart_error.h" |
| 9 #include "tonic/dart_exception_factory.h" | 9 #include "tonic/dart_exception_factory.h" |
| 10 #include "tonic/dart_state.h" | 10 #include "tonic/dart_state.h" |
| 11 #include "tonic/dart_wrapper_info.h" | 11 #include "tonic/dart_wrapper_info.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace tonic { |
| 14 | 14 |
| 15 DartWrappable::~DartWrappable() { | 15 DartWrappable::~DartWrappable() { |
| 16 CHECK(!dart_wrapper_); | 16 CHECK(!dart_wrapper_); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void DartWrappable::AcceptDartGCVisitor(DartGCVisitor& visitor) const { | 19 void DartWrappable::AcceptDartGCVisitor(DartGCVisitor& visitor) const { |
| 20 } | 20 } |
| 21 | 21 |
| 22 Dart_Handle DartWrappable::CreateDartWrapper(DartState* dart_state) { | 22 Dart_Handle DartWrappable::CreateDartWrapper(DartState* dart_state) { |
| 23 DCHECK(!dart_wrapper_); | 23 DCHECK(!dart_wrapper_); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 Dart_Handle result = Dart_GetNativeFieldsOfArgument( | 107 Dart_Handle result = Dart_GetNativeFieldsOfArgument( |
| 108 args, index, DartWrappable::kNumberOfNativeFields, native_fields); | 108 args, index, DartWrappable::kNumberOfNativeFields, native_fields); |
| 109 if (Dart_IsError(result)) { | 109 if (Dart_IsError(result)) { |
| 110 exception = Dart_NewStringFromCString(DartError::kInvalidArgument); | 110 exception = Dart_NewStringFromCString(DartError::kInvalidArgument); |
| 111 return nullptr; | 111 return nullptr; |
| 112 } | 112 } |
| 113 return reinterpret_cast<DartWrappable*>( | 113 return reinterpret_cast<DartWrappable*>( |
| 114 native_fields[DartWrappable::kPeerIndex]); | 114 native_fields[DartWrappable::kPeerIndex]); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace blink | 117 } // namespace tonic |
| OLD | NEW |