| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 namespace syncFileSystem { | 5 namespace syncFileSystem { |
| 6 dictionary StorageInfo { | 6 dictionary StorageInfo { |
| 7 long usage_bytes; | 7 long usage_bytes; |
| 8 long quota_bytes; | 8 long quota_bytes; |
| 9 }; | 9 }; |
| 10 | 10 |
| 11 dictionary SyncState { | 11 dictionary SyncState { |
| 12 DOMString service_name; // i.e. ‘drive’ | 12 DOMString service_name; // i.e. ‘drive’ |
| 13 SyncStateStatus state; | 13 SyncStateStatus state; |
| 14 DOMString description; | 14 DOMString description; |
| 15 }; | 15 }; |
| 16 | 16 |
| 17 enum SyncOperationType { |
| 18 added, updated, deleted |
| 19 }; |
| 20 |
| 17 enum SyncStateStatus { | 21 enum SyncStateStatus { |
| 18 // The sync service is being initialized (e.g. restoring data from the | 22 // The sync service is being initialized (e.g. restoring data from the |
| 19 // database, checking connectivity and authenticating to the service etc). | 23 // database, checking connectivity and authenticating to the service etc). |
| 20 INITIALIZING, | 24 initializing, |
| 21 | 25 |
| 22 // The sync service is up and running. | 26 // The sync service is up and running. |
| 23 RUNNING, | 27 running, |
| 24 | 28 |
| 25 // The sync service is not synchronizing files because the remote service | 29 // The sync service is not synchronizing files because the remote service |
| 26 // needs to be authenticated by the user to proceed. | 30 // needs to be authenticated by the user to proceed. |
| 27 AUTHENTICATION_REQUIRED, | 31 authentication_required, |
| 28 | 32 |
| 29 // The sync service is not synchronizing files because the remote service | 33 // The sync service is not synchronizing files because the remote service |
| 30 // is (temporarily) unavailable due to some recoverable errors, e.g. | 34 // is (temporarily) unavailable due to some recoverable errors, e.g. |
| 31 // network is offline, the remote service is down or not | 35 // network is offline, the remote service is down or not |
| 32 // reachable etc. More details should be given by |description| parameter | 36 // reachable etc. More details should be given by |description| parameter |
| 33 // in OnSyncStateUpdated (which could contain service-specific details). | 37 // in OnSyncStateUpdated (which could contain service-specific details). |
| 34 TEMPORARY_UNAVAILABLE, | 38 temporary_unavailable, |
| 35 | 39 |
| 36 // The sync service is disabled and the content will never sync. | 40 // The sync service is disabled and the content will never sync. |
| 37 // (E.g. this could happen when the user has no account on | 41 // (E.g. this could happen when the user has no account on |
| 38 // the remote service or the sync service has had an unrecoverable | 42 // the remote service or the sync service has had an unrecoverable |
| 39 // error.) | 43 // error.) |
| 40 DISABLED | 44 disabled |
| 41 }; | 45 }; |
| 42 | 46 |
| 43 // [nodoc] A callback type for requestFileSystem. | 47 // [nodoc] A callback type for requestFileSystem. |
| 44 callback GetFileSystemCallback = | 48 callback GetFileSystemCallback = |
| 45 void ([instanceOf=DOMFileSystem] object fileSystem); | 49 void ([instanceOf=DOMFileSystem] object fileSystem); |
| 46 | 50 |
| 47 // [nodoc] A callback type for getUsageAndQuota. | 51 // [nodoc] A callback type for getUsageAndQuota. |
| 48 callback QuotaAndUsageCallback = void (StorageInfo info); | 52 callback QuotaAndUsageCallback = void (StorageInfo info); |
| 49 | 53 |
| 50 // Returns true if operation was successful. | 54 // Returns true if operation was successful. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 64 // Deletes everything in the syncable filesystem. | 68 // Deletes everything in the syncable filesystem. |
| 65 static void deleteFileSystem([instanceOf=DOMFileSystem] object fileSystem, | 69 static void deleteFileSystem([instanceOf=DOMFileSystem] object fileSystem, |
| 66 DeleteFileSystemCallback callback); | 70 DeleteFileSystemCallback callback); |
| 67 }; | 71 }; |
| 68 | 72 |
| 69 interface Events { | 73 interface Events { |
| 70 // Fired when an error or other state change has happened in the | 74 // Fired when an error or other state change has happened in the |
| 71 // sync backend. (E.g. the sync is temporarily disabled due to | 75 // sync backend. (E.g. the sync is temporarily disabled due to |
| 72 // network or authentication error etc) | 76 // network or authentication error etc) |
| 73 static void onSyncStateChanged(SyncState detail); | 77 static void onSyncStateChanged(SyncState detail); |
| 78 |
| 79 // Fired when a file has been updated by the background sync service. |
| 80 // TODO(calvinlo): Convert |file_entry_path| from to Webkit FileEntry. |
| 81 static void onFileSynced(DOMString file_entry_path, |
| 82 SyncOperationType operation); |
| 74 }; | 83 }; |
| 75 }; | 84 }; |
| OLD | NEW |