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 #ifndef VM_DART_API_STATE_H_ | 5 #ifndef VM_DART_API_STATE_H_ |
6 #define VM_DART_API_STATE_H_ | 6 #define VM_DART_API_STATE_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 | 9 |
10 #include "platform/thread.h" | 10 #include "platform/thread.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 }; | 57 }; |
58 | 58 |
59 | 59 |
60 // Implementation of local handles which are handed out from every | 60 // Implementation of local handles which are handed out from every |
61 // dart API call, these handles are valid only in the present scope | 61 // dart API call, these handles are valid only in the present scope |
62 // and are destroyed when a Dart_ExitScope() is called. | 62 // and are destroyed when a Dart_ExitScope() is called. |
63 class LocalHandle { | 63 class LocalHandle { |
64 public: | 64 public: |
65 // Accessors. | 65 // Accessors. |
66 RawObject* raw() const { return raw_; } | 66 RawObject* raw() const { return raw_; } |
67 void set_raw(const Object& object) { raw_ = object.raw(); } | 67 void set_raw(RawObject* raw) { raw_ = raw; } |
68 static intptr_t raw_offset() { return OFFSET_OF(LocalHandle, raw_); } | 68 static intptr_t raw_offset() { return OFFSET_OF(LocalHandle, raw_); } |
69 | 69 |
70 private: | 70 private: |
71 LocalHandle() { } | 71 LocalHandle() { } |
72 ~LocalHandle() { } | 72 ~LocalHandle() { } |
73 | 73 |
74 RawObject* raw_; | 74 RawObject* raw_; |
75 DISALLOW_ALLOCATION(); // Allocated through AllocateHandle methods. | 75 DISALLOW_ALLOCATION(); // Allocated through AllocateHandle methods. |
76 DISALLOW_COPY_AND_ASSIGN(LocalHandle); | 76 DISALLOW_COPY_AND_ASSIGN(LocalHandle); |
77 }; | 77 }; |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 ApiNativeScope::Current()->zone()->GetBaseZone()) {} | 655 ApiNativeScope::Current()->zone()->GetBaseZone()) {} |
656 ApiGrowableArray() | 656 ApiGrowableArray() |
657 : BaseGrowableArray<T, ValueObject>( | 657 : BaseGrowableArray<T, ValueObject>( |
658 ApiNativeScope::Current()->zone()->GetBaseZone()) {} | 658 ApiNativeScope::Current()->zone()->GetBaseZone()) {} |
659 }; | 659 }; |
660 | 660 |
661 | 661 |
662 } // namespace dart | 662 } // namespace dart |
663 | 663 |
664 #endif // VM_DART_API_STATE_H_ | 664 #endif // VM_DART_API_STATE_H_ |
OLD | NEW |