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 | 6 |
7 dictionary StorageInfo { | |
8 long usage_bytes; | |
9 long quota_bytes; | |
10 }; | |
11 | |
12 dictionary SyncState { | |
13 DOMString service_name; // i.e. ‘drive’ | |
14 SyncStateStatus state; | |
15 DOMString description; | |
16 }; | |
17 | |
18 enum SyncOperationResult { | 7 enum SyncOperationResult { |
19 added, updated, deleted, conflicted | 8 added, updated, deleted, conflicted |
20 }; | 9 }; |
21 | 10 |
22 enum SyncStateStatus { | 11 enum SyncStateStatus { |
23 // The sync service is being initialized (e.g. restoring data from the | 12 // The sync service is being initialized (e.g. restoring data from the |
24 // database, checking connectivity and authenticating to the service etc). | 13 // database, checking connectivity and authenticating to the service etc). |
25 initializing, | 14 initializing, |
26 | 15 |
27 // The sync service is up and running. | 16 // The sync service is up and running. |
(...skipping 21 matching lines...) Expand all Loading... |
49 // Not conflicting and has no pending local changes. | 38 // Not conflicting and has no pending local changes. |
50 synced, | 39 synced, |
51 | 40 |
52 // Has one or more pending local changes that haven't been synchronized. | 41 // Has one or more pending local changes that haven't been synchronized. |
53 pending, | 42 pending, |
54 | 43 |
55 // File conflicts with remote version and must be resolved manually. | 44 // File conflicts with remote version and must be resolved manually. |
56 conflicting | 45 conflicting |
57 }; | 46 }; |
58 | 47 |
| 48 dictionary StorageInfo { |
| 49 long usage_bytes; |
| 50 long quota_bytes; |
| 51 }; |
| 52 |
| 53 dictionary SyncState { |
| 54 DOMString service_name; // i.e. ‘drive’ |
| 55 SyncStateStatus state; |
| 56 DOMString description; |
| 57 }; |
| 58 |
59 // [nodoc] A callback type for requestFileSystem. | 59 // [nodoc] A callback type for requestFileSystem. |
60 callback GetFileSystemCallback = | 60 callback GetFileSystemCallback = |
61 void ([instanceOf=DOMFileSystem] object fileSystem); | 61 void ([instanceOf=DOMFileSystem] object fileSystem); |
62 | 62 |
63 // [nodoc] A callback type for getUsageAndQuota. | 63 // [nodoc] A callback type for getUsageAndQuota. |
64 callback QuotaAndUsageCallback = void (StorageInfo info); | 64 callback QuotaAndUsageCallback = void (StorageInfo info); |
65 | 65 |
66 // Returns true if operation was successful. | 66 // Returns true if operation was successful. |
67 callback DeleteFileSystemCallback = void (boolean result); | 67 callback DeleteFileSystemCallback = void (boolean result); |
68 | 68 |
(...skipping 26 matching lines...) Expand all Loading... |
95 // network or authentication error etc). | 95 // network or authentication error etc). |
96 static void onSyncStateChanged(SyncState detail); | 96 static void onSyncStateChanged(SyncState detail); |
97 | 97 |
98 // Fired when a file has been updated by the background sync service. | 98 // Fired when a file has been updated by the background sync service. |
99 // TODO(calvinlo): Convert |file_entry_path| from to Webkit FileEntry. | 99 // TODO(calvinlo): Convert |file_entry_path| from to Webkit FileEntry. |
100 static void onFileSynced(DOMString file_entry_path, | 100 static void onFileSynced(DOMString file_entry_path, |
101 SyncOperationResult result); | 101 SyncOperationResult result); |
102 }; | 102 }; |
103 | 103 |
104 }; | 104 }; |
OLD | NEW |