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

Unified Diff: runtime/vm/message.h

Issue 300223011: - Add possibility to redirect messages if they were not delivered. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/message.h
===================================================================
--- runtime/vm/message.h (revision 36729)
+++ runtime/vm/message.h (working copy)
@@ -23,21 +23,38 @@
kNumPriorities = 2,
} Priority;
+ // Values defining the type of OOB messages. OOB messages can only be
+ // fixed length arrays where the first element is a Smi with one of the
+ // valid values below.
+ typedef enum {
+ kIllegalOOB = 0,
+ kServiceOOBMsg = 1,
+ kIsolateLibOOBMsg = 2
+ } OOBMsgTag;
+
// A port number which is never used.
static const Dart_Port kIllegalPort = 0;
// A new message to be sent between two isolates. The data handed to this
// message will be disposed by calling free() once the message object is
// being destructed (after delivery or when the receiving port is closed).
- Message(Dart_Port dest_port, uint8_t* data, intptr_t len, Priority priority)
+ Message(Dart_Port dest_port,
+ uint8_t* data,
+ intptr_t len,
+ Priority priority,
+ Dart_Port delivery_failure_port = kIllegalPort)
: next_(NULL),
dest_port_(dest_port),
+ delivery_failure_port_(delivery_failure_port),
data_(data),
len_(len),
priority_(priority) {
ASSERT(dest_port != kIllegalPort);
+ ASSERT((priority == kNormalPriority) ||
+ (delivery_failure_port == kIllegalPort));
}
~Message() {
+ ASSERT(delivery_failure_port_ == kIllegalPort);
free(data_);
}
@@ -48,11 +65,14 @@
bool IsOOB() const { return priority_ == Message::kOOBPriority; }
+ bool RedirectToDeliveryFailurePort();
+
private:
friend class MessageQueue;
Message* next_;
Dart_Port dest_port_;
+ Dart_Port delivery_failure_port_;
uint8_t* data_;
intptr_t len_;
Priority priority_;
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698