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

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

Issue 14189023: Fix clang unused-private-field error. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 726
727 static inline ApiNativeScope* Current() { 727 static inline ApiNativeScope* Current() {
728 return reinterpret_cast<ApiNativeScope*>( 728 return reinterpret_cast<ApiNativeScope*>(
729 Thread::GetThreadLocal(Api::api_native_key_)); 729 Thread::GetThreadLocal(Api::api_native_key_));
730 } 730 }
731 731
732 Zone* zone() { return zone_.GetZone(); } 732 Zone* zone() { return zone_.GetZone(); }
733 733
734 private: 734 private:
735 ApiZone zone_; 735 ApiZone zone_;
736 ThreadLocalKey key_;
737 }; 736 };
738 737
739 738
740 // Api growable arrays use a zone for allocation. The constructor 739 // Api growable arrays use a zone for allocation. The constructor
741 // picks the zone from the current isolate if in an isolate 740 // picks the zone from the current isolate if in an isolate
742 // environment. When outside an isolate environment it picks the zone 741 // environment. When outside an isolate environment it picks the zone
743 // from the current native scope. 742 // from the current native scope.
744 template<typename T> 743 template<typename T>
745 class ApiGrowableArray : public BaseGrowableArray<T, ValueObject> { 744 class ApiGrowableArray : public BaseGrowableArray<T, ValueObject> {
746 public: 745 public:
747 explicit ApiGrowableArray(int initial_capacity) 746 explicit ApiGrowableArray(int initial_capacity)
748 : BaseGrowableArray<T, ValueObject>( 747 : BaseGrowableArray<T, ValueObject>(
749 initial_capacity, 748 initial_capacity,
750 ApiNativeScope::Current()->zone()) {} 749 ApiNativeScope::Current()->zone()) {}
751 ApiGrowableArray() 750 ApiGrowableArray()
752 : BaseGrowableArray<T, ValueObject>( 751 : BaseGrowableArray<T, ValueObject>(
753 ApiNativeScope::Current()->zone()) {} 752 ApiNativeScope::Current()->zone()) {}
754 }; 753 };
755 754
756 755
757 } // namespace dart 756 } // namespace dart
758 757
759 #endif // VM_DART_API_STATE_H_ 758 #endif // VM_DART_API_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698