| 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 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 namespace sync_file_system { | 34 namespace sync_file_system { |
| 35 | 35 |
| 36 class FileStatusObserver; | 36 class FileStatusObserver; |
| 37 class LocalChangeProcessor; | 37 class LocalChangeProcessor; |
| 38 class RemoteChangeProcessor; | 38 class RemoteChangeProcessor; |
| 39 | 39 |
| 40 enum RemoteServiceState { | 40 enum RemoteServiceState { |
| 41 // Remote service is up and running, or has not seen any errors yet. | 41 // Remote service is up and running, or has not seen any errors yet. |
| 42 // The consumer of this service can make new requests while the | 42 // The consumer of this service can make new requests while the |
| 43 // service is in this state. | 43 // service is in this state. |
| 44 REMOTE_SERVICE_OK, | 44 REMOTE_SERVICE_OK = 0, |
| 45 | 45 |
| 46 // Remote service is temporarily unavailable due to network, | 46 // Remote service is temporarily unavailable due to network, |
| 47 // authentication or some other temporary failure. | 47 // authentication or some other temporary failure. |
| 48 // This state may be automatically resolved when the underlying | 48 // This state may be automatically resolved when the underlying |
| 49 // network condition or service condition changes. | 49 // network condition or service condition changes. |
| 50 // The consumer of this service can still make new requests but | 50 // The consumer of this service can still make new requests but |
| 51 // they may fail (with recoverable error code). | 51 // they may fail (with recoverable error code). |
| 52 REMOTE_SERVICE_TEMPORARY_UNAVAILABLE, | 52 REMOTE_SERVICE_TEMPORARY_UNAVAILABLE, |
| 53 | 53 |
| 54 // Remote service is temporarily unavailable due to authentication failure. | 54 // Remote service is temporarily unavailable due to authentication failure. |
| 55 // This state may be automatically resolved when the authentication token | 55 // This state may be automatically resolved when the authentication token |
| 56 // has been refreshed internally (e.g. when the user signed in etc). | 56 // has been refreshed internally (e.g. when the user signed in etc). |
| 57 // The consumer of this service can still make new requests but | 57 // The consumer of this service can still make new requests but |
| 58 // they may fail (with recoverable error code). | 58 // they may fail (with recoverable error code). |
| 59 REMOTE_SERVICE_AUTHENTICATION_REQUIRED, | 59 REMOTE_SERVICE_AUTHENTICATION_REQUIRED, |
| 60 | 60 |
| 61 // Remote service is disabled by configuration change or due to some | 61 // Remote service is disabled by configuration change or due to some |
| 62 // unrecoverable errors, e.g. local database corruption. | 62 // unrecoverable errors, e.g. local database corruption. |
| 63 // Any new requests will immediately fail when the service is in | 63 // Any new requests will immediately fail when the service is in |
| 64 // this state. | 64 // this state. |
| 65 REMOTE_SERVICE_DISABLED, | 65 REMOTE_SERVICE_DISABLED, |
| 66 |
| 67 REMOTE_SERVICE_STATE_MAX, |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 // This class represents a backing service of the sync filesystem. | 70 // This class represents a backing service of the sync filesystem. |
| 69 // This also maintains conflict information, i.e. a list of conflicting files | 71 // This also maintains conflict information, i.e. a list of conflicting files |
| 70 // (at least in the current design). | 72 // (at least in the current design). |
| 71 // Owned by SyncFileSystemService. | 73 // Owned by SyncFileSystemService. |
| 72 class RemoteFileSyncService { | 74 class RemoteFileSyncService { |
| 73 public: | 75 public: |
| 74 enum BackendVersion { | 76 enum BackendVersion { |
| 75 V1, | 77 V1, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 235 |
| 234 virtual void PromoteDemotedChanges() = 0; | 236 virtual void PromoteDemotedChanges() = 0; |
| 235 | 237 |
| 236 private: | 238 private: |
| 237 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService); | 239 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService); |
| 238 }; | 240 }; |
| 239 | 241 |
| 240 } // namespace sync_file_system | 242 } // namespace sync_file_system |
| 241 | 243 |
| 242 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ | 244 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ |
| OLD | NEW |