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

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

Issue 10388075: Fix Mac build. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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.cc ('k') | 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 class ApiNativeScope { 619 class ApiNativeScope {
620 public: 620 public:
621 ApiNativeScope() { 621 ApiNativeScope() {
622 // Currently no support for nesting native scopes. 622 // Currently no support for nesting native scopes.
623 ASSERT(Current() == NULL); 623 ASSERT(Current() == NULL);
624 Thread::SetThreadLocal(Api::api_native_key_, reinterpret_cast<uword>(this)); 624 Thread::SetThreadLocal(Api::api_native_key_, reinterpret_cast<uword>(this));
625 } 625 }
626 626
627 ~ApiNativeScope() { 627 ~ApiNativeScope() {
628 ASSERT(Current() == this); 628 ASSERT(Current() == this);
629 Thread::SetThreadLocal(Api::api_native_key_, NULL); 629 Thread::SetThreadLocal(Api::api_native_key_, 0);
630 } 630 }
631 631
632 static inline ApiNativeScope* Current() { 632 static inline ApiNativeScope* Current() {
633 return reinterpret_cast<ApiNativeScope*>( 633 return reinterpret_cast<ApiNativeScope*>(
634 Thread::GetThreadLocal(Api::api_native_key_)); 634 Thread::GetThreadLocal(Api::api_native_key_));
635 } 635 }
636 636
637 ApiZone* zone() { return &zone_; } 637 ApiZone* zone() { return &zone_; }
638 638
639 private: 639 private:
(...skipping 15 matching lines...) Expand all
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_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698