OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 OFFLINE_UNSYNCED, | 641 OFFLINE_UNSYNCED, |
642 // Connected and syncing. | 642 // Connected and syncing. |
643 SYNCING, | 643 SYNCING, |
644 // Connected, no pending changes. | 644 // Connected, no pending changes. |
645 READY, | 645 READY, |
646 // Internal sync error. | 646 // Internal sync error. |
647 CONFLICT, | 647 CONFLICT, |
648 // Can't connect to server, and we haven't completed the initial | 648 // Can't connect to server, and we haven't completed the initial |
649 // sync yet. So there's nothing we can do but wait for the server. | 649 // sync yet. So there's nothing we can do but wait for the server. |
650 OFFLINE_UNUSABLE, | 650 OFFLINE_UNUSABLE, |
| 651 |
| 652 SUMMARY_STATUS_COUNT, |
651 }; | 653 }; |
| 654 |
652 Summary summary; | 655 Summary summary; |
653 | |
654 // Various server related information. | |
655 bool authenticated; // Successfully authenticated via GAIA. | 656 bool authenticated; // Successfully authenticated via GAIA. |
656 bool server_up; // True if we have received at least one good | 657 bool server_up; // True if we have received at least one good |
657 // reply from the server. | 658 // reply from the server. |
658 bool server_reachable; // True if we received any reply from the server. | 659 bool server_reachable; // True if we received any reply from the server. |
659 bool server_broken; // True of the syncer is stopped because of server | 660 bool server_broken; // True of the syncer is stopped because of server |
660 // issues. | 661 // issues. |
| 662 bool notifications_enabled; // True only if subscribed for notifications. |
661 | 663 |
662 bool notifications_enabled; // True only if subscribed for notifications. | 664 // Notifications counters updated by the actions in synapi. |
663 int notifications_received; | 665 int notifications_received; |
664 int notifications_sent; | 666 int notifications_sent; |
665 | 667 |
666 // Various Syncer data. | 668 // The max number of consecutive errors from any component. |
| 669 int max_consecutive_errors; |
| 670 |
667 int unsynced_count; | 671 int unsynced_count; |
| 672 |
668 int conflicting_count; | 673 int conflicting_count; |
669 bool syncing; | 674 bool syncing; |
| 675 // True after a client has done a first sync. |
670 bool initial_sync_ended; | 676 bool initial_sync_ended; |
| 677 // True if any syncer is stuck. |
671 bool syncer_stuck; | 678 bool syncer_stuck; |
| 679 |
| 680 // Total updates available. If zero, nothing left to download. |
672 int64 updates_available; | 681 int64 updates_available; |
673 int64 updates_received; | 682 // Total updates received by the syncer since browser start. |
| 683 int updates_received; |
| 684 |
| 685 // Of updates_received, how many were tombstones. |
| 686 int tombstone_updates_received; |
674 bool disk_full; | 687 bool disk_full; |
675 bool invalid_store; | |
676 int max_consecutive_errors; // The max number of errors from any component. | |
677 }; | 688 }; |
678 | 689 |
679 // An interface the embedding application implements to receive notifications | 690 // An interface the embedding application implements to receive notifications |
680 // from the SyncManager. Register an observer via SyncManager::AddObserver. | 691 // from the SyncManager. Register an observer via SyncManager::AddObserver. |
681 // This observer is an event driven model as the events may be raised from | 692 // This observer is an event driven model as the events may be raised from |
682 // different internal threads, and simply providing an "OnStatusChanged" type | 693 // different internal threads, and simply providing an "OnStatusChanged" type |
683 // notification complicates things such as trying to determine "what changed", | 694 // notification complicates things such as trying to determine "what changed", |
684 // if different members of the Status object are modified from different | 695 // if different members of the Status object are modified from different |
685 // threads. This way, the event is explicit, and it is safe for the Observer | 696 // threads. This way, the event is explicit, and it is safe for the Observer |
686 // to dispatch to a native thread or synchronize accordingly. | 697 // to dispatch to a native thread or synchronize accordingly. |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 // This allows actual HttpPostProvider subclass implementations to be | 999 // This allows actual HttpPostProvider subclass implementations to be |
989 // reference counted, which is useful if a particular implementation uses | 1000 // reference counted, which is useful if a particular implementation uses |
990 // multiple threads to serve network requests. | 1001 // multiple threads to serve network requests. |
991 virtual void Destroy(HttpPostProviderInterface* http) = 0; | 1002 virtual void Destroy(HttpPostProviderInterface* http) = 0; |
992 virtual ~HttpPostProviderFactory() { } | 1003 virtual ~HttpPostProviderFactory() { } |
993 }; | 1004 }; |
994 | 1005 |
995 } // namespace sync_api | 1006 } // namespace sync_api |
996 | 1007 |
997 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 1008 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |