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

Unified Diff: runtime/bin/dartutils.h

Issue 15018011: dart:io | Add FileSystemEntity.stat() and FileStat class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix Windows failures. Created 7 years, 7 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.h
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index a9b86f717a86186880706c82275cf5af67161afe..051086b74be8969ff49ae1f6400fef62d0c65947 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -207,6 +207,12 @@ class DartUtils {
class CObject {
public:
+ // These match the constants in sdk/lib/io/common.dart.
Søren Gjesse 2013/05/14 13:50:36 These constants should be moved. They are not part
Bill Hesse 2013/05/14 16:33:58 I would do this, but I don't know where you think
Søren Gjesse 2013/05/15 14:06:35 Let's create a new class NativePortRPC with these
+ static const int kSuccess = 0;
+ static const int kArgumentError = 1;
+ static const int kOSError = 2;
+ static const int kFileClosedError = 3;
+
explicit CObject(Dart_CObject *cobject) : cobject_(cobject) {}
Dart_CObject::Type type() { return cobject_->type; }
Dart_CObject::TypedDataType byte_array_type() {
@@ -254,6 +260,9 @@ class CObject {
static Dart_CObject* NewDouble(double value);
static Dart_CObject* NewString(int length);
static Dart_CObject* NewString(const char* str);
Søren Gjesse 2013/05/14 13:50:36 I don't think this comment belongs here. It is spe
Bill Hesse 2013/05/14 16:33:58 Removed. But the RPC protocol is exactly the func
Søren Gjesse 2013/05/15 14:06:35 That's right, see comment above.
+ // A CObject array cannot be returned as the result, since errors are
+ // encoded as arrays starting with a nonzero first element. It must be
+ // wrapped in an array starting with kSuccess, and unwrapped by the receiver.
static Dart_CObject* NewArray(int length);
static Dart_CObject* NewUint8Array(int length);
static Dart_CObject* NewExternalUint8Array(
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/dartutils.cc » ('j') | runtime/bin/file.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698