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

Unified Diff: runtime/bin/file.dart

Issue 8431028: Implement async file API on top of isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type mismatch. Created 9 years, 2 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/file.cc ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.dart
diff --git a/runtime/bin/file.dart b/runtime/bin/file.dart
index ce2d929665f21fc3019232c713b621176c42ef40..a9ec181958142cc497601a87892f3f2bf350ee88 100644
--- a/runtime/bin/file.dart
+++ b/runtime/bin/file.dart
@@ -88,10 +88,10 @@ interface File factory _File {
void writeByte(int value);
/**
- * Synchronously write a single byte to the file. Returns true if
- * the byte was successfully written and false otherwise.
+ * Synchronously write a single byte to the file. Returns the
+ * number of bytes successfully written.
*/
- bool writeByteSync(int value);
+ int writeByteSync(int value);
/**
* Write a List<int> to the file. If the list cannot be written the
@@ -101,10 +101,10 @@ interface File factory _File {
void writeList(List<int> buffer, int offset, int bytes);
/**
- * Synchronously write a List<int> to the file. Returns true if the
- * list was successfully written and false otherwise.
+ * Synchronously write a List<int> to the file. Returns the number
+ * of bytes successfully written.
*/
- bool writeListSync(List<int> buffer, int offset, int bytes);
+ int writeListSync(List<int> buffer, int offset, int bytes);
/**
* Write a string to the file. If the string cannot be written the
@@ -115,11 +115,11 @@ interface File factory _File {
void writeString(String string);
/**
- * Synchronously write a single string to the file. Returns true if
- * the string was successfully written and false otherwise.
+ * Synchronously write a single string to the file. Returns the number
+ * of characters successfully written.
*/
// TODO(ager): writeStringSync should take an encoding.
- bool writeStringSync(String string);
+ int writeStringSync(String string);
/**
* Get the current position of the file. When the operation
@@ -145,9 +145,8 @@ interface File factory _File {
int lengthSync();
/**
- * Flush the contents of the file to disk. If there are no pending
- * write operation after the flush operation completes, the
- * [noPendingWriteHandler] is called.
+ * Flush the contents of the file to disk. The [flushHandler] is
+ * called when the flush operation completes.
*/
void flush();
@@ -181,6 +180,9 @@ interface File factory _File {
void set readByteHandler(void handler(int byte));
void set readListHandler(void handler(int read));
void set noPendingWriteHandler(void handler());
+ void set positionHandler(void handler(int position));
+ void set lengthHandler(void handler(int length));
+ void set flushHandler(void handler());
void set errorHandler(void handler(String error));
}
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698