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

Unified Diff: runtime/vm/snapshot.cc

Issue 9348019: Add support for byte arrays to native messages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 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/dart_api_state.h ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 016465ab74358eeb10683528c0766a82c18607a7..43c12dabff90ea8e02ff5f6a992ef2035403b594 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -576,6 +576,19 @@ void MessageWriter::WriteCObject(Dart_CObject* object) {
}
break;
}
+ case Dart_CObject::kByteArray: {
+ // Write out the serialization header value for this object.
+ WriteInlinedHeader(object);
+ // Write out the class and tags information.
+ WriteObjectHeader(ObjectStore::kInternalByteArrayClass, 0);
+ uint8_t* bytes = object->value.as_byte_array.values;
+ intptr_t len = object->value.as_byte_array.length;
+ WriteSmi(len);
+ for (intptr_t i = 0; i < len; i++) {
+ Write<uint8_t>(bytes[i]);
+ }
+ break;
+ }
default:
UNREACHABLE();
}
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698