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

Unified Diff: runtime/bin/dartutils.cc

Issue 14142008: Add support for more typed data types on native ports (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 7dd85348756a09a47eb1b78893eb0aad33f5a4be..7375c84a08cadcc1432d0a1c208e3c4dad2d179d 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -678,7 +678,8 @@ Dart_CObject* CObject::NewArray(int length) {
Dart_CObject* CObject::NewUint8Array(int length) {
- Dart_CObject* cobject = New(Dart_CObject::kUint8Array, length);
+ Dart_CObject* cobject = New(Dart_CObject::kByteArray, length);
+ cobject->value.as_byte_array.type = Dart_CObject::kUint8Array;
cobject->value.as_byte_array.length = length;
cobject->value.as_byte_array.values = reinterpret_cast<uint8_t*>(cobject + 1);
return cobject;
@@ -688,7 +689,8 @@ Dart_CObject* CObject::NewUint8Array(int length) {
Dart_CObject* CObject::NewExternalUint8Array(
int64_t length, uint8_t* data, void* peer,
Dart_WeakPersistentHandleFinalizer callback) {
- Dart_CObject* cobject = New(Dart_CObject::kExternalUint8Array);
+ Dart_CObject* cobject = New(Dart_CObject::kExternalByteArray);
+ cobject->value.as_external_byte_array.type = Dart_CObject::kUint8Array;
cobject->value.as_external_byte_array.length = length;
cobject->value.as_external_byte_array.data = data;
cobject->value.as_external_byte_array.peer = peer;
@@ -704,7 +706,7 @@ Dart_CObject* CObject::NewIOBuffer(int64_t length) {
void CObject::FreeIOBufferData(Dart_CObject* cobject) {
- ASSERT(cobject->type == Dart_CObject::kExternalUint8Array);
+ ASSERT(cobject->type == Dart_CObject::kExternalByteArray);
cobject->value.as_external_byte_array.callback(
NULL, cobject->value.as_external_byte_array.peer);
cobject->value.as_external_byte_array.data = NULL;

Powered by Google App Engine
This is Rietveld 408576698