| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |