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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 9195031: Add ByteArray interface and provide internal and external implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address remaining review comments Created 8 years, 11 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/class_finalizer.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index fabeaf7b2c025f864b7f85d978691eac89617447..f43dda3dab2b8951ab9d17c2882326afe5f1f867 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1404,7 +1404,7 @@ DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t* len) {
return result;
}
}
- return Api::NewError("Object does not implement the list inteface");
+ return Api::NewError("Object does not implement the 'List' inteface");
}
@@ -1660,6 +1660,24 @@ DART_EXPORT Dart_Handle Dart_ListSetAsBytes(Dart_Handle list,
}
+// --- Byte Arrays ---
+
+
+DART_EXPORT bool Dart_IsByteArray(Dart_Handle object) {
+ DARTSCOPE(Isolate::Current());
+ const Object& obj = Object::Handle(Api::UnwrapHandle(object));
+ return obj.IsByteArray();
+}
+
+
+DART_EXPORT Dart_Handle Dart_NewByteArray(intptr_t length) {
+ DARTSCOPE(Isolate::Current());
+ const InternalByteArray& obj =
+ InternalByteArray::Handle(InternalByteArray::New(length));
+ return Api::NewLocalHandle(obj);
+}
+
+
// --- Closures ---
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698