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

Unified Diff: runtime/bin/dartutils.h

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
« no previous file with comments | « no previous file | runtime/bin/dartutils.cc » ('j') | runtime/vm/dart_api_message.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.h
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index 8ecad89962606d9a5981d69213a6416283c74ece..af7e18d7d734364aa4c43a1a54d9aac4a8caace0 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -169,6 +169,10 @@ class CObject {
static Dart_CObject* NewString(const char* str);
static Dart_CObject* NewArray(int length);
static Dart_CObject* NewUint8Array(int length);
+ static Dart_CObject* NewExternalUint8Array(int length,
+ uint8_t* data,
+ void* peer,
+ Dart_PeerFinalizer callback);
Dart_CObject* AsApiCObject() { return cobject_; }
@@ -305,4 +309,17 @@ class CObjectUint8Array : public CObject {
uint8_t* Buffer() const { return cobject_->value.as_byte_array.values; }
};
+
+class CObjectExternalUint8Array : public CObject {
+ public:
+ DECLARE_COBJECT_CONSTRUCTORS(ExternalUint8Array)
+
+ int Length() const { return cobject_->value.as_external_byte_array.length; }
+ uint8_t* Data() const { return cobject_->value.as_external_byte_array.data; }
+ void* Peer() const { return cobject_->value.as_external_byte_array.peer; }
+ Dart_PeerFinalizer Callback() const {
+ return cobject_->value.as_external_byte_array.callback;
+ }
siva 2012/06/28 16:44:05 DISALLOW_COPY_AND_ASSIGN(...); Seems to be missin
Mads Ager (google) 2012/06/28 18:06:51 Me neither, but they are there now. Thanks. :)
+};
+
#endif // BIN_DARTUTILS_H_
« no previous file with comments | « no previous file | runtime/bin/dartutils.cc » ('j') | runtime/vm/dart_api_message.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698