Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: runtime/vm/dart_api_state.h

Issue 10928065: Revert "Revert "Finalize reachable weak persistent handles at isolate shutdown."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Overload the raw_ field as a next pointer when adding freed 173 // Overload the raw_ field as a next pointer when adding freed
174 // handles to the free list. 174 // handles to the free list.
175 FinalizablePersistentHandle* Next() { 175 FinalizablePersistentHandle* Next() {
176 return reinterpret_cast<FinalizablePersistentHandle*>(raw_); 176 return reinterpret_cast<FinalizablePersistentHandle*>(raw_);
177 } 177 }
178 void SetNext(FinalizablePersistentHandle* free_list) { 178 void SetNext(FinalizablePersistentHandle* free_list) {
179 raw_ = reinterpret_cast<RawObject*>(free_list); 179 raw_ = reinterpret_cast<RawObject*>(free_list);
180 ASSERT(!raw_->IsHeapObject()); 180 ASSERT(!raw_->IsHeapObject());
181 } 181 }
182 void FreeHandle(FinalizablePersistentHandle* free_list) { 182 void FreeHandle(FinalizablePersistentHandle* free_list) {
183 Clear();
183 SetNext(free_list); 184 SetNext(free_list);
184 } 185 }
185 186
186 void Clear() { 187 void Clear() {
187 raw_ = Object::null(); 188 raw_ = Object::null();
188 peer_ = NULL; 189 peer_ = NULL;
189 callback_ = NULL; 190 callback_ = NULL;
190 } 191 }
191 192
192 RawObject* raw_; 193 RawObject* raw_;
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 ApiNativeScope::Current()->zone()->GetBaseZone()) {} 674 ApiNativeScope::Current()->zone()->GetBaseZone()) {}
674 ApiGrowableArray() 675 ApiGrowableArray()
675 : BaseGrowableArray<T, ValueObject>( 676 : BaseGrowableArray<T, ValueObject>(
676 ApiNativeScope::Current()->zone()->GetBaseZone()) {} 677 ApiNativeScope::Current()->zone()->GetBaseZone()) {}
677 }; 678 };
678 679
679 680
680 } // namespace dart 681 } // namespace dart
681 682
682 #endif // VM_DART_API_STATE_H_ 683 #endif // VM_DART_API_STATE_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698