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

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: Add implementation 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
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/dartutils.cc » ('j') | no next file with comments »
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 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.
+ static const int kSuccess = 0;
+ static const int kArgumentError = 1;
Bill Hesse 2013/05/14 11:34:12 We could make all but kSuccess private, but kSucce
+ 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);
+ // 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698