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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 10698011: Support posting of external data into dart as external uint8 arrays through the Dart API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
Index: runtime/vm/dart_api_message.cc
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index 7fb311ffa895897652dc7f24dca2d87212af4da9..12b2e5783ec51d925242fa3869b3146fe27dd74f 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -715,6 +715,22 @@ void ApiMessageWriter::WriteCObjectInlined(Dart_CObject* object,
}
break;
}
+ case Dart_CObject::kExternalUint8Array: {
+ // Write out serialization header value for this object.
+ WriteInlinedHeader(object);
+ // Write out the class and tag information.
+ WriteObjectHeader(ObjectStore::kExternalUint8ArrayClass, 0);
+ int length = object->value.as_external_byte_array.length;
+ uint8_t* data = object->value.as_external_byte_array.data;
+ void* peer = object->value.as_external_byte_array.peer;
+ Dart_PeerFinalizer callback =
+ object->value.as_external_byte_array.callback;
+ WriteSmi(length);
+ WriteIntptrValue(reinterpret_cast<intptr_t>(data));
+ WriteIntptrValue(reinterpret_cast<intptr_t>(peer));
+ WriteIntptrValue(reinterpret_cast<intptr_t>(callback));
siva 2012/06/28 16:44:05 As discussed offline we need some mechanism to ens
Mads Ager (google) 2012/06/28 18:06:51 Done.
+ break;
+ }
default:
UNREACHABLE();
}

Powered by Google App Engine
This is Rietveld 408576698