Commit 5e5d8cab authored by mtomasz's avatar mtomasz Committed by Commit bot

[fsp] Cleanup IDL.

This CL adds descriptions to dictionaries.

TEST=Tested manually with a test server.
BUG=248427

Review URL: https://codereview.chromium.org/527723002

Cr-Commit-Position: refs/heads/master@{#293121}
parent 1cb929f1
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h"] implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h"]
namespace fileSystemProvider { namespace fileSystemProvider {
// Error codes used by providing extensions in response to requests. For // Error codes used by providing extensions in response to requests. For
// success, <code>OK</code> should be used. // success, <code>OK</code> must be used.
enum ProviderError { enum ProviderError {
OK, OK,
FAILED, FAILED,
...@@ -59,33 +59,53 @@ namespace fileSystemProvider { ...@@ -59,33 +59,53 @@ namespace fileSystemProvider {
// Represents a mounted file system. // Represents a mounted file system.
dictionary FileSystemInfo { dictionary FileSystemInfo {
// The identifier of the file system.
DOMString fileSystemId; DOMString fileSystemId;
// A human-readable name for the file system.
DOMString displayName; DOMString displayName;
// Whether the file system supports operations which may change contents
// of the file system (such as creating, deleting or writing to files).
[nodoc] boolean writable; [nodoc] boolean writable;
}; };
// Options for the <code>mount()</code> method. // Options for the <code>mount()</code> method.
dictionary MountOptions { dictionary MountOptions {
// The string indentifier of the file system. Must be unique per each
// extension.
DOMString fileSystemId; DOMString fileSystemId;
// A human-readable name for the file system.
DOMString displayName; DOMString displayName;
// Whether the file system supports operations which may change contents
// of the file system (such as creating, deleting or writing to files).
[nodoc] boolean? writable; [nodoc] boolean? writable;
}; };
// Options for the <code>unmount()</code> method. // Options for the <code>unmount()</code> method.
dictionary UnmountOptions { dictionary UnmountOptions {
// The identifier of the file system to be unmounted.
DOMString fileSystemId; DOMString fileSystemId;
}; };
// Options for the <code>onUnmountRequested()</code> event. // Options for the <code>onUnmountRequested()</code> event.
dictionary UnmountRequestedOptions { dictionary UnmountRequestedOptions {
// The identifier of the file system to be unmounted.
DOMString fileSystemId; DOMString fileSystemId;
long requestId; long requestId;
}; };
// Options for the <code>onGetMetadataRequested()</code> event. // Options for the <code>onGetMetadataRequested()</code> event.
dictionary GetMetadataRequestedOptions { dictionary GetMetadataRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The path of the entry to fetch metadata about.
DOMString entryPath; DOMString entryPath;
// Set to <code>true</code> if the thumbnail is requested. // Set to <code>true</code> if the thumbnail is requested.
...@@ -94,95 +114,176 @@ namespace fileSystemProvider { ...@@ -94,95 +114,176 @@ namespace fileSystemProvider {
// Options for the <code>onReadDirectoryRequested()</code> event. // Options for the <code>onReadDirectoryRequested()</code> event.
dictionary ReadDirectoryRequestedOptions { dictionary ReadDirectoryRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The path of the directory which contents are requested.
DOMString directoryPath; DOMString directoryPath;
}; };
// Options for the <code>onOpenFileRequested()</code> event. // Options for the <code>onOpenFileRequested()</code> event.
dictionary OpenFileRequestedOptions { dictionary OpenFileRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// A request ID which will be used by consecutive read/write and close
// requests.
long requestId; long requestId;
// The path of the file to be opened.
DOMString filePath; DOMString filePath;
// Whether the file will be used for reading or writing.
OpenFileMode mode; OpenFileMode mode;
}; };
// Options for the <code>onCloseFileRequested()</code> event. // Options for the <code>onCloseFileRequested()</code> event.
dictionary CloseFileRequestedOptions { dictionary CloseFileRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// A request ID used to open the file.
long openRequestId; long openRequestId;
}; };
// Options for the <code>onReadFileRequested()</code> event. // Options for the <code>onReadFileRequested()</code> event.
dictionary ReadFileRequestedOptions { dictionary ReadFileRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// A request ID used to open the file.
long openRequestId; long openRequestId;
// Position in the file (in bytes) to start reading from.
double offset; double offset;
// Number of bytes to be returned.
double length; double length;
}; };
// Options for the <code>onCreateDirectoryRequested()</code> event. // Options for the <code>onCreateDirectoryRequested()</code> event.
dictionary CreateDirectoryRequestedOptions { dictionary CreateDirectoryRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The path of the directory to be created.
DOMString directoryPath; DOMString directoryPath;
// Whether the operation is recursive (for directories only).
boolean recursive; boolean recursive;
}; };
// Options for the <code>onDeleteEntryRequested()</code> event. // Options for the <code>onDeleteEntryRequested()</code> event.
dictionary DeleteEntryRequestedOptions { dictionary DeleteEntryRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The path of the entry to be deleted.
DOMString entryPath; DOMString entryPath;
// Whether the operation is recursive (for directories only).
boolean recursive; boolean recursive;
}; };
// Options for the <code>onCreateFileRequested()</code> event. // Options for the <code>onCreateFileRequested()</code> event.
dictionary CreateFileRequestedOptions { dictionary CreateFileRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The path of the file to be created.
DOMString filePath; DOMString filePath;
}; };
// Options for the <code>onCopyEntryRequested()</code> event. // Options for the <code>onCopyEntryRequested()</code> event.
dictionary CopyEntryRequestedOptions { dictionary CopyEntryRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The source path of the entry to be copied.
DOMString sourcePath; DOMString sourcePath;
// The destination path for the copy operation.
DOMString targetPath; DOMString targetPath;
}; };
// Options for the <code>onMoveEntryRequested()</code> event. // Options for the <code>onMoveEntryRequested()</code> event.
dictionary MoveEntryRequestedOptions { dictionary MoveEntryRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The source path of the entry to be moved into a new place.
DOMString sourcePath; DOMString sourcePath;
// The destination path for the copy operation.
DOMString targetPath; DOMString targetPath;
}; };
// Options for the <code>onTruncateRequested()</code> event. // Options for the <code>onTruncateRequested()</code> event.
dictionary TruncateRequestedOptions { dictionary TruncateRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// The path of the file to be truncated.
DOMString filePath; DOMString filePath;
// Number of bytes to be retained after the operation completes.
double length; double length;
}; };
// Options for the <code>onWriteFileRequested()</code> event. // Options for the <code>onWriteFileRequested()</code> event.
dictionary WriteFileRequestedOptions { dictionary WriteFileRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// A request ID used to open the file.
long openRequestId; long openRequestId;
// Position in the file (in bytes) to start writing the bytes from.
double offset; double offset;
// Buffer of bytes to be written to the file.
ArrayBuffer data; ArrayBuffer data;
}; };
// Options for the <code>onAbortRequested()</code> event. // Options for the <code>onAbortRequested()</code> event.
dictionary AbortRequestedOptions { dictionary AbortRequestedOptions {
// The identifier of the file system related to this operation.
DOMString fileSystemId; DOMString fileSystemId;
// The unique identifier of this request.
long requestId; long requestId;
// An ID of the request to be aborted.
long operationRequestId; long operationRequestId;
}; };
...@@ -224,7 +325,7 @@ namespace fileSystemProvider { ...@@ -224,7 +325,7 @@ namespace fileSystemProvider {
// displayName</code>. <code>displayName</code> will be shown in the left // displayName</code>. <code>displayName</code> will be shown in the left
// panel of Files.app. <code>displayName</code> can contain any characters // panel of Files.app. <code>displayName</code> can contain any characters
// including '/', but cannot be an empty string. <code>displayName</code> // including '/', but cannot be an empty string. <code>displayName</code>
// should be descriptive but doesn't have to be unique. Duplicate display // must be descriptive but doesn't have to be unique. Duplicate display
// names are uniquified by adding suffix like "(1)" in the Files app UI. // names are uniquified by adding suffix like "(1)" in the Files app UI.
// //
// If a file system with the passed <code>fileSystemId</code> is already // If a file system with the passed <code>fileSystemId</code> is already
...@@ -236,7 +337,7 @@ namespace fileSystemProvider { ...@@ -236,7 +337,7 @@ namespace fileSystemProvider {
[nocompile] ErrorCallback errorCallback); [nocompile] ErrorCallback errorCallback);
// Unmounts a file system with the given <code>fileSystemId</code>. It // Unmounts a file system with the given <code>fileSystemId</code>. It
// should be called after <code>onUnmountRequested</code> is invoked. Also, // must be called after <code>onUnmountRequested</code> is invoked. Also,
// the providing extension can decide to perform unmounting if not requested // the providing extension can decide to perform unmounting if not requested
// (eg. in case of lost connection, or a file error). If there is no file // (eg. in case of lost connection, or a file error). If there is no file
// system with the requested id, or unmounting fails, then the // system with the requested id, or unmounting fails, then the
...@@ -252,7 +353,7 @@ namespace fileSystemProvider { ...@@ -252,7 +353,7 @@ namespace fileSystemProvider {
interface Events { interface Events {
// Raised when unmounting for the file system with the <code>fileSystemId // Raised when unmounting for the file system with the <code>fileSystemId
// </code> identifier is requested. In the response, the <code>unmount // </code> identifier is requested. In the response, the <code>unmount
// </code> API method should be called together with <code>successCallback // </code> API method must be called together with <code>successCallback
// </code>. If unmounting is not possible (eg. due to a pending operation), // </code>. If unmounting is not possible (eg. due to a pending operation),
// then <code>errorCallback</code> must be called. // then <code>errorCallback</code> must be called.
[maxListeners=1] static void onUnmountRequested( [maxListeners=1] static void onUnmountRequested(
...@@ -261,7 +362,7 @@ namespace fileSystemProvider { ...@@ -261,7 +362,7 @@ namespace fileSystemProvider {
ProviderErrorCallback errorCallback); ProviderErrorCallback errorCallback);
// Raised when metadata of a file or a directory at <code>entryPath</code> // Raised when metadata of a file or a directory at <code>entryPath</code>
// is requested. The metadata should be returned with the <code> // is requested. The metadata must be returned with the <code>
// successCallback</code> call. In case of an error, <code>errorCallback // successCallback</code> call. In case of an error, <code>errorCallback
// </code> must be called. // </code> must be called.
[maxListeners=1] static void onGetMetadataRequested( [maxListeners=1] static void onGetMetadataRequested(
...@@ -270,7 +371,7 @@ namespace fileSystemProvider { ...@@ -270,7 +371,7 @@ namespace fileSystemProvider {
ProviderErrorCallback errorCallback); ProviderErrorCallback errorCallback);
// Raised when contents of a directory at <code>directoryPath</code> are // Raised when contents of a directory at <code>directoryPath</code> are
// requested. The results should be returned in chunks by calling the <code> // requested. The results must be returned in chunks by calling the <code>
// successCallback</code> several times. In case of an error, <code> // successCallback</code> several times. In case of an error, <code>
// errorCallback</code> must be called. // errorCallback</code> must be called.
[maxListeners=1] static void onReadDirectoryRequested( [maxListeners=1] static void onReadDirectoryRequested(
...@@ -293,7 +394,7 @@ namespace fileSystemProvider { ...@@ -293,7 +394,7 @@ namespace fileSystemProvider {
ProviderErrorCallback errorCallback); ProviderErrorCallback errorCallback);
// Raised when reading contents of a file opened previously with <code> // Raised when reading contents of a file opened previously with <code>
// openRequestId</code> is requested. The results should be returned in // openRequestId</code> is requested. The results must be returned in
// chunks by calling <code>successCallback</code> several times. In case of // chunks by calling <code>successCallback</code> several times. In case of
// an error, <code>errorCallback</code> must be called. // an error, <code>errorCallback</code> must be called.
[maxListeners=1] static void onReadFileRequested( [maxListeners=1] static void onReadFileRequested(
...@@ -356,10 +457,10 @@ namespace fileSystemProvider { ...@@ -356,10 +457,10 @@ namespace fileSystemProvider {
// Raised when aborting an operation with <code>operationRequestId</code> // Raised when aborting an operation with <code>operationRequestId</code>
// is requested. The operation executed with <code>operationRequestId</code> // is requested. The operation executed with <code>operationRequestId</code>
// should be immediately stopped and <code>successCallback</code> of this // must be immediately stopped and <code>successCallback</code> of this
// abort request executed. If aborting fails, then <code>errorCallback // abort request executed. If aborting fails, then <code>errorCallback
// </code> must be called. Note, that callbacks of the aborted operation // </code> must be called. Note, that callbacks of the aborted operation
// should not be called, as they will be ignored. Despite calling <code> // must not be called, as they will be ignored. Despite calling <code>
// errorCallback</code>, the request may be forcibly aborted. // errorCallback</code>, the request may be forcibly aborted.
[maxListeners=1, nodoc] static void onAbortRequested( [maxListeners=1, nodoc] static void onAbortRequested(
AbortRequestedOptions options, AbortRequestedOptions options,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment