Chromium Code Reviews| Index: runtime/vm/message.h |
| diff --git a/runtime/vm/message.h b/runtime/vm/message.h |
| index 80d1df56d1c8c210d08072e18a41da9cab03addb..e5e7796d59098649f8724502257f2a3bb64e427d 100644 |
| --- a/runtime/vm/message.h |
| +++ b/runtime/vm/message.h |
| @@ -23,6 +23,15 @@ class Message { |
| kNumPriorities = 2, |
| } Priority; |
| + typedef enum { |
| + kNormalType = 0, // Normal message. |
| + kServiceType = 1, // Service isolate message. |
|
siva
2013/07/19 17:41:16
I am not sure about this message type encoding her
|
| + |
| + // Iteration. |
| + kFirstType = 0, |
| + kNumTypes = 2, |
| + } Type; |
| + |
| // A port number which is never used. |
| static const Dart_Port kIllegalPort = 0; |
| @@ -31,14 +40,15 @@ class Message { |
| // being destructed (after delivery or when the receiving port is closed). |
| // |
| // If reply_port is kIllegalPort, then there is no reply port. |
| - Message(Dart_Port dest_port, Dart_Port reply_port, |
| - uint8_t* data, intptr_t len, Priority priority) |
| + Message(Dart_Port dest_port, Dart_Port reply_port, uint8_t* data, |
| + intptr_t len, Priority priority, Type type = kNormalType) |
| : next_(NULL), |
| dest_port_(dest_port), |
| reply_port_(reply_port), |
| data_(data), |
| len_(len), |
| - priority_(priority) {} |
| + priority_(priority), |
| + type_(type) {} |
| ~Message() { |
| free(data_); |
| } |
| @@ -48,8 +58,10 @@ class Message { |
| uint8_t* data() const { return data_; } |
| intptr_t len() const { return len_; } |
| Priority priority() const { return priority_; } |
| + Type type() const { return type_; } |
| bool IsOOB() const { return priority_ == Message::kOOBPriority; } |
| + bool IsService() const { return type_ == Message::kServiceType; } |
| private: |
| friend class MessageQueue; |
| @@ -60,6 +72,7 @@ class Message { |
| uint8_t* data_; |
| intptr_t len_; |
| Priority priority_; |
| + Type type_; |
| DISALLOW_COPY_AND_ASSIGN(Message); |
| }; |