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

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

Issue 243973002: - Add a minimal implementation of Capability. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/json_stream.cc ('k') | runtime/vm/message_handler.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_MESSAGE_H_ 5 #ifndef VM_MESSAGE_H_
6 #define VM_MESSAGE_H_ 6 #define VM_MESSAGE_H_
7 7
8 #include "vm/thread.h" 8 #include "vm/thread.h"
9 9
10 // Duplicated from dart_api.h to avoid including the whole header. 10 // Duplicated from dart_api.h to avoid including the whole header.
(...skipping 16 matching lines...) Expand all
27 static const Dart_Port kIllegalPort = 0; 27 static const Dart_Port kIllegalPort = 0;
28 28
29 // A new message to be sent between two isolates. The data handed to this 29 // A new message to be sent between two isolates. The data handed to this
30 // message will be disposed by calling free() once the message object is 30 // message will be disposed by calling free() once the message object is
31 // being destructed (after delivery or when the receiving port is closed). 31 // being destructed (after delivery or when the receiving port is closed).
32 Message(Dart_Port dest_port, uint8_t* data, intptr_t len, Priority priority) 32 Message(Dart_Port dest_port, uint8_t* data, intptr_t len, Priority priority)
33 : next_(NULL), 33 : next_(NULL),
34 dest_port_(dest_port), 34 dest_port_(dest_port),
35 data_(data), 35 data_(data),
36 len_(len), 36 len_(len),
37 priority_(priority) {} 37 priority_(priority) {
38 ASSERT(dest_port != kIllegalPort);
39 }
38 ~Message() { 40 ~Message() {
39 free(data_); 41 free(data_);
40 } 42 }
41 43
42 Dart_Port dest_port() const { return dest_port_; } 44 Dart_Port dest_port() const { return dest_port_; }
43 uint8_t* data() const { return data_; } 45 uint8_t* data() const { return data_; }
44 intptr_t len() const { return len_; } 46 intptr_t len() const { return len_; }
45 Priority priority() const { return priority_; } 47 Priority priority() const { return priority_; }
46 48
47 bool IsOOB() const { return priority_ == Message::kOOBPriority; } 49 bool IsOOB() const { return priority_ == Message::kOOBPriority; }
(...skipping 30 matching lines...) Expand all
78 80
79 Message* head_; 81 Message* head_;
80 Message* tail_; 82 Message* tail_;
81 83
82 DISALLOW_COPY_AND_ASSIGN(MessageQueue); 84 DISALLOW_COPY_AND_ASSIGN(MessageQueue);
83 }; 85 };
84 86
85 } // namespace dart 87 } // namespace dart
86 88
87 #endif // VM_MESSAGE_H_ 89 #endif // VM_MESSAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698