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

Unified Diff: runtime/vm/service.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/port.cc ('k') | runtime/vm/service/message.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
===================================================================
--- runtime/vm/service.cc (revision 36729)
+++ runtime/vm/service.cc (working copy)
@@ -162,8 +162,11 @@
StackZone zone(isolate);
HANDLESCOPE(isolate);
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, sp, arguments->NativeArgAt(0));
- GET_NON_NULL_NATIVE_ARGUMENT(Instance, message, arguments->NativeArgAt(1));
+ GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(1));
+ // Set the type of the OOB message.
+ message.SetAt(0, Smi::Handle(isolate, Smi::New(Message::kServiceOOBMsg)));
+
// Serialize message.
uint8_t* data = NULL;
MessageWriter writer(&data, &allocator);
@@ -619,24 +622,24 @@
void Service::HandleIsolateMessage(Isolate* isolate, const Instance& msg) {
ASSERT(isolate != NULL);
ASSERT(!msg.IsNull());
- ASSERT(msg.IsGrowableObjectArray());
+ ASSERT(msg.IsArray());
{
StackZone zone(isolate);
HANDLESCOPE(isolate);
- const GrowableObjectArray& message = GrowableObjectArray::Cast(msg);
- // Message is a list with four entries.
- ASSERT(message.Length() == 4);
+ const Array& message = Array::Cast(msg);
+ // Message is a list with five entries.
+ ASSERT(message.Length() == 5);
Instance& reply_port = Instance::Handle(isolate);
GrowableObjectArray& path = GrowableObjectArray::Handle(isolate);
- GrowableObjectArray& option_keys = GrowableObjectArray::Handle(isolate);
- GrowableObjectArray& option_values = GrowableObjectArray::Handle(isolate);
- reply_port ^= message.At(0);
- path ^= message.At(1);
- option_keys ^= message.At(2);
- option_values ^= message.At(3);
+ Array& option_keys = Array::Handle(isolate);
+ Array& option_values = Array::Handle(isolate);
+ reply_port ^= message.At(1);
+ path ^= message.At(2);
+ option_keys ^= message.At(3);
+ option_values ^= message.At(4);
ASSERT(!path.IsNull());
ASSERT(!option_keys.IsNull());
@@ -1833,25 +1836,25 @@
void Service::HandleRootMessage(const Instance& msg) {
Isolate* isolate = Isolate::Current();
ASSERT(!msg.IsNull());
- ASSERT(msg.IsGrowableObjectArray());
+ ASSERT(msg.IsArray());
{
StackZone zone(isolate);
HANDLESCOPE(isolate);
- const GrowableObjectArray& message = GrowableObjectArray::Cast(msg);
- // Message is a list with four entries.
- ASSERT(message.Length() == 4);
+ const Array& message = Array::Cast(msg);
+ // Message is a list with five entries.
+ ASSERT(message.Length() == 5);
Instance& reply_port = Instance::Handle(isolate);
GrowableObjectArray& path = GrowableObjectArray::Handle(isolate);
- GrowableObjectArray& option_keys = GrowableObjectArray::Handle(isolate);
- GrowableObjectArray& option_values = GrowableObjectArray::Handle(isolate);
+ Array& option_keys = Array::Handle(isolate);
+ Array& option_values = Array::Handle(isolate);
- reply_port ^= message.At(0);
- path ^= message.At(1);
- option_keys ^= message.At(2);
- option_values ^= message.At(3);
+ reply_port ^= message.At(1);
+ path ^= message.At(2);
+ option_keys ^= message.At(3);
+ option_values ^= message.At(4);
ASSERT(!path.IsNull());
ASSERT(!option_keys.IsNull());
« no previous file with comments | « runtime/vm/port.cc ('k') | runtime/vm/service/message.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698