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

Unified Diff: runtime/bin/dartutils.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: Address comments. 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
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 9d0a7a56e863dfaf08601f0e3c11678ae5d5d9da..6939332786ac04bb663718db0f9d879c8dccd611 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -433,6 +433,19 @@ Dart_CObject* CObject::NewUint8Array(int length) {
}
+Dart_CObject* CObject::NewExternalUint8Array(int length,
+ uint8_t* data,
+ void* peer,
+ Dart_PeerFinalizer callback) {
+ Dart_CObject* cobject = New(Dart_CObject::kExternalUint8Array);
+ cobject->value.as_external_byte_array.length = length;
+ cobject->value.as_external_byte_array.data = data;
+ cobject->value.as_external_byte_array.peer = peer;
+ cobject->value.as_external_byte_array.callback = callback;
+ return cobject;
+}
+
+
static int kIllegalArgumentError = 1;
static int kOSError = 2;
static int kFileClosedError = 3;
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698