| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
| 6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
| 7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
| 8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
| 9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
| 10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // Can't connect to server, but there are no pending changes in | 402 // Can't connect to server, but there are no pending changes in |
| 403 // our local cache. | 403 // our local cache. |
| 404 OFFLINE, | 404 OFFLINE, |
| 405 // Can't connect to server, and there are pending changes in our | 405 // Can't connect to server, and there are pending changes in our |
| 406 // local cache. | 406 // local cache. |
| 407 OFFLINE_UNSYNCED, | 407 OFFLINE_UNSYNCED, |
| 408 // Connected and syncing. | 408 // Connected and syncing. |
| 409 SYNCING, | 409 SYNCING, |
| 410 // Connected, no pending changes. | 410 // Connected, no pending changes. |
| 411 READY, | 411 READY, |
| 412 // User has chosen to pause syncing. |
| 413 PAUSED, |
| 412 // Internal sync error. | 414 // Internal sync error. |
| 413 CONFLICT, | 415 CONFLICT, |
| 414 // Can't connect to server, and we haven't completed the initial | 416 // Can't connect to server, and we haven't completed the initial |
| 415 // sync yet. So there's nothing we can do but wait for the server. | 417 // sync yet. So there's nothing we can do but wait for the server. |
| 416 OFFLINE_UNUSABLE, | 418 OFFLINE_UNUSABLE, |
| 417 }; | 419 }; |
| 418 Summary summary; | 420 Summary summary; |
| 419 | 421 |
| 420 // Various server related information. | 422 // Various server related information. |
| 421 bool authenticated; // Successfully authenticated via GAIA. | 423 bool authenticated; // Successfully authenticated via GAIA. |
| 422 bool server_up; // True if we have received at least one good | 424 bool server_up; // True if we have received at least one good |
| 423 // reply from the server. | 425 // reply from the server. |
| 424 bool server_reachable; // True if we received any reply from the server. | 426 bool server_reachable; // True if we received any reply from the server. |
| 425 bool server_broken; // True of the syncer is stopped because of server | 427 bool server_broken; // True of the syncer is stopped because of server |
| 426 // issues. | 428 // issues. |
| 427 | 429 |
| 428 bool notifications_enabled; // True only if subscribed for notifications. | 430 bool notifications_enabled; // True only if subscribed for notifications. |
| 429 int notifications_received; | 431 int notifications_received; |
| 430 int notifications_sent; | 432 int notifications_sent; |
| 431 | 433 |
| 432 // Various Syncer data. | 434 // Various Syncer data. |
| 433 int unsynced_count; | 435 int unsynced_count; |
| 434 int conflicting_count; | 436 int conflicting_count; |
| 435 bool syncing; | 437 bool syncing; |
| 438 bool syncer_paused; |
| 436 bool initial_sync_ended; | 439 bool initial_sync_ended; |
| 437 bool syncer_stuck; | 440 bool syncer_stuck; |
| 438 int64 updates_available; | 441 int64 updates_available; |
| 439 int64 updates_received; | 442 int64 updates_received; |
| 440 bool disk_full; | 443 bool disk_full; |
| 441 bool invalid_store; | 444 bool invalid_store; |
| 442 int max_consecutive_errors; // The max number of errors from any component. | 445 int max_consecutive_errors; // The max number of errors from any component. |
| 443 }; | 446 }; |
| 444 | 447 |
| 445 // An interface the embedding application implements to receive notifications | 448 // An interface the embedding application implements to receive notifications |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 // Subclasses should implement to invoke DoWork on |visitor| once on a thread | 705 // Subclasses should implement to invoke DoWork on |visitor| once on a thread |
| 703 // appropriate for data model modifications. | 706 // appropriate for data model modifications. |
| 704 // While it doesn't hurt, the impl does not need to be re-entrant (for now). | 707 // While it doesn't hurt, the impl does not need to be re-entrant (for now). |
| 705 // Note: |visitor| is owned by caller. | 708 // Note: |visitor| is owned by caller. |
| 706 virtual void CallDoWorkFromModelSafeThreadAndWait(Visitor* visitor) = 0; | 709 virtual void CallDoWorkFromModelSafeThreadAndWait(Visitor* visitor) = 0; |
| 707 }; | 710 }; |
| 708 | 711 |
| 709 } // namespace sync_api | 712 } // namespace sync_api |
| 710 | 713 |
| 711 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 714 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
| OLD | NEW |