Chromium Code Reviews| Index: runtime/bin/file.dart |
| diff --git a/runtime/bin/file.dart b/runtime/bin/file.dart |
| index 8b36398de65da86d82731cea87e09aea0da6955f..a4298ad9795aa8e74b5ab207344211fa2a0d6e62 100644 |
| --- a/runtime/bin/file.dart |
| +++ b/runtime/bin/file.dart |
| @@ -29,8 +29,8 @@ interface File default _File { |
| File(String name); |
| /** |
| - * Check if the file exists. The [existsHandler] is called with the |
| - * result when the operation completes. |
| + * Check if the file exists. [onExists] is called with the result |
| + * when the operation completes. |
| */ |
| void exists(); |
| @@ -40,8 +40,8 @@ interface File default _File { |
| bool existsSync(); |
| /** |
| - * Create the file. The [createHandler] is called when the file has |
| - * been created. The [errorHandler] is called if the file cannot be |
| + * Create the file. [onCreate] is called when the file has been |
| + * created. [onError] is called if the file cannot be |
| * created. Existing files are left untouched by create. Calling |
| * create on an existing file might fail if there are restrictive |
| * permissions on the file. |
| @@ -56,9 +56,9 @@ interface File default _File { |
| void createSync(); |
| /** |
| - * Delete the file. The [deleteHandler] is called when the file has |
| - * been successfully deleted. The [errorHandler] is called if the |
| - * file cannot be deleted. |
| + * Delete the file. [onDelete] is called when the file has been |
| + * successfully deleted. [onError] is called if the file cannot be |
| + * deleted. |
| */ |
| void delete(); |
| @@ -69,9 +69,8 @@ interface File default _File { |
| /** |
| * Get a Directory object for the directory containing this file. If |
| - * the file does not exist the [errorHandler] is called. When the |
| - * operation completes the [directoryHandler] is called with the |
| - * result. |
| + * the file does not exist [onError] is called. When the operation |
| + * completes [onDirectory] is called with the result. |
| */ |
| void directory(); |
| @@ -83,15 +82,14 @@ interface File default _File { |
| /** |
| * Open the file for random access operations. When the file is |
| - * opened the [openHandler] is called with the resulting |
| + * opened [onOpen] is called with the resulting |
| * RandomAccessFile. RandomAccessFiles must be closed using the |
| - * [close] method. If the file cannot be opened the [errorHandler] |
| - * is called. |
| + * [close] method. If the file cannot be opened [onError] is called. |
| * |
| * Files can be opened in three modes: |
| * |
| * FileMode.READ: open the file for reading. If the file does not |
| - * exist the [errorHandler] is called. |
| + * exist [onError] is called. |
| * |
| * FileMode.WRITE: open the file for both reading and writing and |
| * truncate the file to length zero. If the file does not exist the |
| @@ -115,8 +113,8 @@ interface File default _File { |
| RandomAccessFile openSync([FileMode mode]); |
| /** |
| - * Get the canonical full path corresponding to the file name. The |
| - * [fullPathHandler] is called with the result when the fullPath |
| + * Get the canonical full path corresponding to the file name. |
| + * [onFullPath] is called with the result when the fullPath |
| * operation completes. |
| */ |
| void fullPath(); |
| @@ -152,8 +150,8 @@ interface File default _File { |
| /** |
| * Read the entire file contents as a list of bytes. When the |
| - * operation completes the [readAsBytesHandler] is called. |
| - * The [errorHandler] is called if the operation fails. |
| + * operation completes [onReadAsBytes] is called. [onError] is |
| + * called if the operation fails. |
| */ |
| void readAsBytes(); |
| @@ -167,9 +165,8 @@ interface File default _File { |
| * ('UTF-8', 'ISO-8859-1', 'ASCII'). By default the encoding is |
| * 'UTF-8'. |
| * |
| - * When the operation completes the [readAsTextHandler] is called |
| - * with the resulting string. The [errorHandler] is called if the |
| - * operation fails. |
| + * When the operation completes [onReadAsText] is called with the |
| + * resulting string. [onError] is called if the operation fails. |
| */ |
| void readAsText([String encoding]); |
| @@ -185,9 +182,8 @@ interface File default _File { |
| * [encoding] ('UTF-8', 'ISO-8859-1', 'ASCII'). By default the |
| * encoding is 'UTF-8'. |
| * |
| - * When the operation completes the [readAsLinesHandler] is called |
| - * with the resulting string. The [errorHandler] is called if the |
| - * operation fails. |
| + * When the operation completes [onReadAsLines] is called with the |
| + * resulting string. [onError] is called if the operation fails. |
| */ |
| void readAsLines(); |
| @@ -207,61 +203,61 @@ interface File default _File { |
| * Sets the handler that gets called when an [exists] operation |
| * completes. |
| */ |
| - void set existsHandler(void handler(bool exists)); |
| + void set onExists(void handler(bool exists)); |
| /** |
| * Sets the handler that gets called when a [create] operation |
| * completes. |
| */ |
| - void set createHandler(void handler()); |
| + void set onCreate(void handler()); |
|
Søren Gjesse
2012/02/29 07:41:24
onCreated?
|
| /** |
| * Sets the handler that gets called when a [delete] operation |
| * completes. |
| */ |
| - void set deleteHandler(void handler()); |
| + void set onDelete(void handler()); |
|
Søren Gjesse
2012/02/29 07:41:24
onDeleted?
|
| /** |
| * Sets the handler that gets called when a [directory] operation |
| * completes. |
| */ |
| - void set directoryHandler(void handler(Directory directory)); |
| + void set onDirectory(void handler(Directory directory)); |
| /** |
| * Sets the handler that gets called when an [open] operation |
| * completes. |
| */ |
| - void set openHandler(void handler(RandomAccessFile openedFile)); |
| + void set onOpen(void handler(RandomAccessFile openedFile)); |
|
Søren Gjesse
2012/02/29 07:41:24
OnOpened?
|
| /** |
| * Set the handler that gets called when a [readAsBytes] operation |
| * completes. |
| */ |
| - void set readAsBytesHandler(void handler(List<int> bytes)); |
| + void set onReadAsBytes(void handler(List<int> bytes)); |
| /** |
| * Set the handler that gets called when a [readAsText] operation |
| * completes. |
| */ |
| - void set readAsTextHandler(void handler(String text)); |
| + void set onReadAsText(void handler(String text)); |
| /** |
| * Set the handler that gets called when a [readAsLines] operation |
| * completes. |
| */ |
| - void set readAsLinesHandler(void handler(List<String> lines)); |
| + void set onReadAsLines(void handler(List<String> lines)); |
| /** |
| * Sets the handler that gets called when a [fullPath] operation |
| * completes. |
| */ |
| - void set fullPathHandler(void handler(String path)); |
| + void set onFullPath(void handler(String path)); |
| /** |
| * Sets the handler that gets called when errors occur during |
| * operations on this file. |
| */ |
| - void set errorHandler(void handler(String error)); |
| + void set onError(void handler(String error)); |
| } |
| @@ -272,8 +268,7 @@ interface File default _File { |
| */ |
| interface RandomAccessFile { |
| /** |
| - * Close the file. When the file is closed the [closeHandler] is |
| - * called. |
| + * Close the file. When the file is closed [onClose] is called. |
| */ |
| void close(); |
| @@ -284,7 +279,7 @@ interface RandomAccessFile { |
| /** |
| * Read a byte from the file. When the byte has been read the |
| - * [readByteHandler] is called with the value. |
| + * [onReadByte] is called with the value. |
| */ |
| void readByte(); |
| @@ -295,7 +290,7 @@ interface RandomAccessFile { |
| /** |
| * Read a List<int> from the file. When the list has been read the |
| - * [readListHandler] is called with an integer indicating how much |
| + * [onReadList] is called with an integer indicating how much |
| * was read. |
| */ |
| void readList(List<int> buffer, int offset, int bytes); |
| @@ -308,8 +303,8 @@ interface RandomAccessFile { |
| /** |
| * Write a single byte to the file. If the byte cannot be written |
| - * the [errorHandler] is called. When all pending write operations |
| - * have finished the [noPendingWriteHandler] is called. |
| + * [onError] is called. When all pending write operations have |
| + * finished [onNoPendingWrite] is called. |
| */ |
| void writeByte(int value); |
| @@ -321,8 +316,8 @@ interface RandomAccessFile { |
| /** |
| * Write a List<int> to the file. If the list cannot be written the |
| - * [errorHandler] is called. When all pending write operations have |
| - * finished the [noPendingWriteHandler] is called. |
| + * [onError] is called. When all pending write operations have |
| + * finished [onNoPendingWrite] is called. |
| */ |
| void writeList(List<int> buffer, int offset, int bytes); |
| @@ -334,8 +329,8 @@ interface RandomAccessFile { |
| /** |
| * Write a string to the file. If the string cannot be written the |
| - * [errorHandler] is called. When all pending write operations have |
| - * finished the [noPendingWriteHandler] is called. |
| + * [onError] is called. When all pending write operations have |
| + * finished [onNoPendingWrite] is called. |
| */ |
| // TODO(ager): writeString should take an encoding. |
| void writeString(String string); |
| @@ -349,7 +344,7 @@ interface RandomAccessFile { |
| /** |
| * Get the current byte position in the file. When the operation |
| - * completes the [positionHandler] is called with the position. |
| + * completes [onPosition] is called with the position. |
| */ |
| void position(); |
| @@ -360,7 +355,7 @@ interface RandomAccessFile { |
| /** |
| * Set the byte position in the file. When the operation completes |
| - * the [setPositionHandler] is called. |
| + * [onSetPosition] is called. |
| */ |
| void setPosition(int position); |
| @@ -371,7 +366,7 @@ interface RandomAccessFile { |
| /** |
| * Truncate (or extend) the file to [length] bytes. When the |
| - * operation completes successfully the [truncateHandler] is called. |
| + * operation completes successfully [onTruncate] is called. |
| */ |
| void truncate(int length); |
| @@ -382,7 +377,7 @@ interface RandomAccessFile { |
| /** |
| * Get the length of the file. When the operation completes the |
| - * [lengthHandler] is called with the length. |
| + * [onLength] is called with the length. |
| */ |
| void length(); |
| @@ -392,7 +387,7 @@ interface RandomAccessFile { |
| int lengthSync(); |
| /** |
| - * Flush the contents of the file to disk. The [flushHandler] is |
| + * Flush the contents of the file to disk. [onOnFlush] is |
| * called when the flush operation completes. |
| */ |
| void flush(); |
| @@ -411,61 +406,61 @@ interface RandomAccessFile { |
| * Sets the handler that gets called when a [close] operation |
| * completes. |
| */ |
| - void set closeHandler(void handler()); |
| + void set onClose(void handler()); |
| /** |
| * Sets the handler that gets called when a [readByte] operation |
| * completes. |
| */ |
| - void set readByteHandler(void handler(int byte)); |
| + void set onReadByte(void handler(int byte)); |
|
Søren Gjesse
2012/02/29 07:41:24
onByteRead?
|
| /** |
| * Sets the handler that gets called when a [readList] operation |
| * completes. |
| */ |
| - void set readListHandler(void handler(int read)); |
| + void set onReadList(void handler(int read)); |
|
Søren Gjesse
2012/02/29 07:41:24
onListRead?
|
| /** |
| * Sets the handler that gets called when there are no more write |
| * operations pending for this file. |
| */ |
| - void set noPendingWriteHandler(void handler()); |
| + void set onNoPendingWrite(void handler()); |
|
Søren Gjesse
2012/02/29 07:41:24
onNoPendingWrites (with an s)?
|
| /** |
| * Sets the handler that gets called when a [position] operation |
| * completes. |
| */ |
| - void set positionHandler(void handler(int position)); |
| + void set onPosition(void handler(int position)); |
| /** |
| * Sets the handler that gets called when a [setPosition] operation |
| * completes. |
| */ |
| - void set setPositionHandler(void handler()); |
| + void set onSetPosition(void handler()); |
|
Søren Gjesse
2012/02/29 07:41:24
OnPositionSet?
|
| /** |
| * Sets the handler that gets called when a [truncate] operation |
| * completes. |
| */ |
| - void set truncateHandler(void handler()); |
| + void set onTruncate(void handler()); |
|
Søren Gjesse
2012/02/29 07:41:24
OnTruncated?
|
| /** |
| * Sets the handler that gets called when a [length] operation |
| * completes. |
| */ |
| - void set lengthHandler(void handler(int length)); |
| + void set onLength(void handler(int length)); |
| /** |
| * Sets the handler that gets called when a [flush] operation |
| * completes. |
| */ |
| - void set flushHandler(void handler()); |
| + void set onFlush(void handler()); |
|
Søren Gjesse
2012/02/29 07:41:24
onFlushed?
|
| /** |
| * Sets the handler that gets called when errors occur when |
| * operating on this file. |
| */ |
| - void set errorHandler(void handler(String error)); |
| + void set onError(void handler(String error)); |
| } |