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

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

Issue 9348019: Add support for byte arrays to native messages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 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_message.cc ('k') | runtime/vm/snapshot.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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 528
529 static inline ApiNativeScope* Current() { 529 static inline ApiNativeScope* Current() {
530 return reinterpret_cast<ApiNativeScope*>( 530 return reinterpret_cast<ApiNativeScope*>(
531 Thread::GetThreadLocal(Api::api_native_key_)); 531 Thread::GetThreadLocal(Api::api_native_key_));
532 } 532 }
533 533
534 ApiZone* zone() { return &zone_; } 534 ApiZone* zone() { return &zone_; }
535 535
536 private: 536 private:
537 ApiZone zone_; 537 ApiZone zone_;
538 ThreadLocalKey key_;
538 }; 539 };
539 540
540 541
541 // Api growable arrays use a zone for allocation. The constructor 542 // Api growable arrays use a zone for allocation. The constructor
542 // picks the zone from the current isolate if in an isolate 543 // picks the zone from the current isolate if in an isolate
543 // environment. When outside an isolate environment it picks the zone 544 // environment. When outside an isolate environment it picks the zone
544 // from the current native scope. 545 // from the current native scope.
545 template<typename T> 546 template<typename T>
546 class ApiGrowableArray : public BaseGrowableArray<T, ValueObject> { 547 class ApiGrowableArray : public BaseGrowableArray<T, ValueObject> {
547 public: 548 public:
548 explicit ApiGrowableArray(int initial_capacity) 549 explicit ApiGrowableArray(int initial_capacity)
549 : BaseGrowableArray<T, ValueObject>( 550 : BaseGrowableArray<T, ValueObject>(
550 initial_capacity, 551 initial_capacity,
551 ApiNativeScope::Current()->zone()->GetBaseZone()) {} 552 ApiNativeScope::Current()->zone()->GetBaseZone()) {}
552 ApiGrowableArray() 553 ApiGrowableArray()
553 : BaseGrowableArray<T, ValueObject>( 554 : BaseGrowableArray<T, ValueObject>(
554 ApiNativeScope::Current()->zone()->GetBaseZone()) {} 555 ApiNativeScope::Current()->zone()->GetBaseZone()) {}
555 }; 556 };
556 557
557 558
558 } // namespace dart 559 } // namespace dart
559 560
560 #endif // VM_DART_API_STATE_H_ 561 #endif // VM_DART_API_STATE_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_message.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698