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

Unified Diff: runtime/bin/dartutils.cc

Issue 9415043: Port async file operations to be using native ports instead or an isolate (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed remaining issues Created 8 years, 10 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 b472e7975946cb8c2b8f01a183560ba6053f06e6..763b5e982ce5590f1e5e95d03e92272e402ceacf 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -322,6 +322,14 @@ Dart_CObject* CObject::NewInt64(int64_t value) {
}
+Dart_CObject* CObject::NewIntptr(intptr_t value) {
+ // Pointer values passed as intptr_t are always send as int64_t.
+ Dart_CObject* cobject = New(Dart_CObject::kInt64);
+ cobject->value.as_int64 = value;
+ return cobject;
+}
+
+
Dart_CObject* CObject::NewDouble(double value) {
Dart_CObject* cobject = New(Dart_CObject::kDouble);
cobject->value.as_double = value;
@@ -352,3 +360,11 @@ Dart_CObject* CObject::NewArray(int length) {
reinterpret_cast<Dart_CObject**>(cobject + 1);
return cobject;
}
+
+
+Dart_CObject* CObject::NewByteArray(int length) {
+ Dart_CObject* cobject = New(Dart_CObject::kByteArray, length);
+ cobject->value.as_byte_array.length = length;
+ cobject->value.as_byte_array.values = reinterpret_cast<uint8_t*>(cobject + 1);
+ return cobject;
+}
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/file.h » ('j') | runtime/bin/file.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698