| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Internal, used by fileSystemProvider's custom bindings. These functions are | 5 // Internal, used by fileSystemProvider's custom bindings. These functions are |
| 6 // called when events' callbacks are invoked. | 6 // called when events' callbacks are invoked. |
| 7 [platforms=("chromeos"), | 7 [platforms=("chromeos"), |
| 8 implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy
stem_provider_api.h", nodoc] | 8 implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy
stem_provider_api.h", nodoc] |
| 9 namespace fileSystemProviderInternal { | 9 namespace fileSystemProviderInternal { |
| 10 interface Functions { | 10 interface Functions { |
| 11 // Internal. Success callback of the <code>onUnmountRequested</code> | 11 // Internal. Success callback of the <code>onUnmountRequested</code> |
| 12 // event. Must be called when unmounting is completed. | 12 // event. Must be called when unmounting is completed. |
| 13 static void unmountRequestedSuccess(DOMString fileSystemId, | 13 static void unmountRequestedSuccess(DOMString fileSystemId, |
| 14 long requestId); | 14 long requestId); |
| 15 | 15 |
| 16 // Internal. Error callback of the <code>onUnmountRequested</code> |
| 17 // event. Must be called if unmounting fails. |
| 18 static void unmountRequestedError( |
| 19 DOMString fileSystemId, |
| 20 long requestId, |
| 21 fileSystemProvider.ProviderError error); |
| 22 |
| 16 // Internal. Success callback of the <code>onGetMetadataRequested</code> | 23 // Internal. Success callback of the <code>onGetMetadataRequested</code> |
| 17 // event. Must be called if metadata is available. | 24 // event. Must be called if metadata is available. |
| 18 static void getMetadataRequestedSuccess( | 25 static void getMetadataRequestedSuccess( |
| 19 DOMString fileSystemId, | 26 DOMString fileSystemId, |
| 20 long requestId, | 27 long requestId, |
| 21 fileSystemProvider.EntryMetadata metadata); | 28 fileSystemProvider.EntryMetadata metadata); |
| 22 | 29 |
| 30 // Internal. Error callback of the <code>onGetMetadataRequested</code> |
| 31 // event. Must be called when obtaining metadata fails. |
| 32 static void getMetadataRequestedError( |
| 33 DOMString fileSystemId, |
| 34 long requestId, |
| 35 fileSystemProvider.ProviderError error); |
| 36 |
| 23 // Internal. Success callback of the <code>onReadDirectoryRequested</code> | 37 // Internal. Success callback of the <code>onReadDirectoryRequested</code> |
| 24 // event. Can be called multiple times per request. | 38 // event. Can be called multiple times per request. |
| 25 static void readDirectoryRequestedSuccess( | 39 static void readDirectoryRequestedSuccess( |
| 26 DOMString fileSystemId, | 40 DOMString fileSystemId, |
| 27 long requestId, | 41 long requestId, |
| 28 fileSystemProvider.EntryMetadata[] entries, | 42 fileSystemProvider.EntryMetadata[] entries, |
| 29 boolean hasMore); | 43 boolean hasMore); |
| 30 | 44 |
| 45 // Internal. Error callback of the <code>onReadDirectoryRequested</code> |
| 46 // event. Must be called when reading a directory fails. |
| 47 static void readDirectoryRequestedError( |
| 48 DOMString fileSystemId, |
| 49 long requestId, |
| 50 fileSystemProvider.ProviderError error); |
| 51 |
| 31 // Internal. Success callback of the <code>onOpenFileRequested</code> event. | 52 // Internal. Success callback of the <code>onOpenFileRequested</code> event. |
| 32 // Must be called, when opening succeeds. | 53 // Must be called, when opening succeeds. |
| 33 static void openFileRequestedSuccess( | 54 static void openFileRequestedSuccess( |
| 34 DOMString fileSystemId, | 55 DOMString fileSystemId, |
| 35 long requestId); | 56 long requestId); |
| 36 | 57 |
| 58 // Internal. Error callback of the <code>onOpenFileRequested</code> event. |
| 59 // Must be called when opening fails. |
| 60 static void openFileRequestedError( |
| 61 DOMString fileSystemId, |
| 62 long requestId, |
| 63 fileSystemProvider.ProviderError error); |
| 64 |
| 37 // Internal. Success callback of the <code>onCloseFileRequested</code> | 65 // Internal. Success callback of the <code>onCloseFileRequested</code> |
| 38 // event. Must be called, when closing succeeds. | 66 // event. Must be called, when closing succeeds. |
| 39 static void closeFileRequestedSuccess( | 67 static void closeFileRequestedSuccess( |
| 40 DOMString fileSystemId, | 68 DOMString fileSystemId, |
| 41 long requestId); | 69 long requestId); |
| 42 | 70 |
| 71 // Internal. Error callback of the <code>onCloseFileRequested</code> event. |
| 72 // Must be called when closing fails. |
| 73 static void closeFileRequestedError( |
| 74 DOMString fileSystemId, |
| 75 long requestId, |
| 76 fileSystemProvider.ProviderError error); |
| 77 |
| 43 // Internal. Success callback of the <code>onReadFileRequested</code> | 78 // Internal. Success callback of the <code>onReadFileRequested</code> |
| 44 // event. Can be called multiple times per request. | 79 // event. Can be called multiple times per request. |
| 45 static void readFileRequestedSuccess( | 80 static void readFileRequestedSuccess( |
| 46 DOMString fileSystemId, | 81 DOMString fileSystemId, |
| 47 long requestId, | 82 long requestId, |
| 48 ArrayBuffer data, | 83 ArrayBuffer data, |
| 49 boolean hasMore); | 84 boolean hasMore); |
| 50 | 85 |
| 51 // Internal. Error callback of all of the operation requests. Must be called | 86 // Internal. Error callback of the <code>onReadFileRequested</code> |
| 52 // if an operation fails. | 87 // event. Must be called when reading a file fails. |
| 53 static void operationRequestedError( | 88 static void readFileRequestedError( |
| 54 DOMString fileSystemId, | 89 DOMString fileSystemId, |
| 55 long requestId, | 90 long requestId, |
| 56 fileSystemProvider.ProviderError error); | 91 fileSystemProvider.ProviderError error); |
| 57 | |
| 58 }; | 92 }; |
| 59 }; | 93 }; |
| 60 | 94 |
| OLD | NEW |