Index: runtime/vm/native_message_handler.cc |
diff --git a/runtime/vm/native_message_handler.cc b/runtime/vm/native_message_handler.cc |
index ebc7121c84895ddd193c3ed90128fdbca84e8eb9..6b3f143346526800ccc2b5cd90d91dc124db3df8 100644 |
--- a/runtime/vm/native_message_handler.cc |
+++ b/runtime/vm/native_message_handler.cc |
@@ -6,6 +6,7 @@ |
#include "vm/isolate.h" |
#include "vm/message.h" |
+#include "vm/snapshot.h" |
#include "vm/thread.h" |
namespace dart { |
@@ -47,12 +48,18 @@ static void RunWorker(uword parameter) { |
// dispatched to special vm code. Implement. |
UNIMPLEMENTED(); |
} |
- // TODO(sgjesse): Once CMessageReader::ReadObject is committed, |
- // use that here and pass the resulting data object to the |
- // handler instead. |
+ // Create a new zone for allocating all the structures for the |
+ // decoded message. |
+ Zone zone; |
siva
2012/02/04 01:55:43
Instead of modifying zone to accept a version with
Søren Gjesse
2012/02/06 16:25:52
The problem with using an ApiZone here is that the
siva
2012/02/07 01:03:24
You could make BaseGrowableArray use BaseZone* as
|
+ int32_t length = reinterpret_cast<int32_t*>( |
+ message->data())[Snapshot::kLengthIndex]; |
+ CMessageReader message_reader(message->data() + Snapshot::kHeaderSize, |
+ length, |
+ &zone); |
siva
2012/02/04 01:55:43
Do you really want a version of the reader with a
Søren Gjesse
2012/02/06 16:25:52
We do need a thread local if we are not passing in
siva
2012/02/07 01:03:24
I have reviewed that change, it seems fine to abst
|
+ Dart_CMessage* cmessage = message_reader.ReadMessage(); |
(*handler->func())(message->dest_port(), |
message->reply_port(), |
- message->data()); |
+ cmessage); |
delete message; |
} |
} |