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

Unified Diff: runtime/vm/message.cc

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/message.h ('k') | runtime/vm/message_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/message.cc
===================================================================
--- runtime/vm/message.cc (revision 36729)
+++ runtime/vm/message.cc (working copy)
@@ -4,8 +4,20 @@
#include "vm/message.h"
+#include "vm/port.h"
+
namespace dart {
+bool Message::RedirectToDeliveryFailurePort() {
+ if (delivery_failure_port_ == kIllegalPort) {
+ return false;
+ }
+ dest_port_ = delivery_failure_port_;
+ delivery_failure_port_ = kIllegalPort;
+ return true;
+}
+
+
MessageQueue::MessageQueue() {
head_ = NULL;
tail_ = NULL;
@@ -59,7 +71,11 @@
tail_ = NULL;
while (cur != NULL) {
Message* next = cur->next_;
- delete cur;
+ if (cur->RedirectToDeliveryFailurePort()) {
+ PortMap::PostMessage(cur);
+ } else {
+ delete cur;
+ }
cur = next;
}
}
« no previous file with comments | « runtime/vm/message.h ('k') | runtime/vm/message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698