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

Unified Diff: runtime/bin/file.h

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/file.h
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index deffe0e42c4d2ed5cf28fd173d0ae1cc6affee35..8c84041204f9bb6f77439bcec0d0d42ddfca17f3 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -29,6 +29,14 @@ class File {
kWriteTruncate = kWrite | kTruncate
};
+ // These values have to be kept in sync with the mode values of
+ // FileMode.READ, FileMode.WRITE and FileMode.APPEND in file.dart.
+ enum DartFileOpenMode {
+ kDartRead = 0,
+ kDartWrite = 1,
+ kDartAppend = 2
+ };
+
enum StdioHandleType {
kTerminal = 0,
kPipe = 1,
@@ -36,6 +44,25 @@ class File {
kOther = 3
};
+ enum FileRequest {
+ kExistsRequest = 0,
+ kCreateRequest = 1,
+ kDeleteRequest = 2,
+ kOpenRequest = 3,
+ kFullPathRequest = 4,
+ kCloseRequest = 5,
+ kPositionRequest = 6,
+ kSetPositionRequest = 7,
+ kTruncateRequest = 8,
+ kLengthRequest = 9,
+ kFlushRequest = 10,
+ kReadByteRequest = 11,
+ kWriteByteRequest = 12,
+ kReadListRequest = 13,
+ kWriteListRequest = 14,
+ kWriteStringRequest = 15
+ };
+
~File();
// Read/Write attempt to transfer num_bytes to/from buffer. It returns
@@ -92,6 +119,8 @@ class File {
static const char* StringEscapedPathSeparator();
static StdioHandleType GetStdioHandleType(int fd);
+ static FileOpenMode DartModeToFileMode(DartFileOpenMode mode);
+
private:
File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { }
void Close();
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/file.cc » ('j') | runtime/bin/file.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698