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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 // WARNING: Calling methods on the SyncManager before receiving this | 655 // WARNING: Calling methods on the SyncManager before receiving this |
656 // message, unless otherwise specified, produces undefined behavior. | 656 // message, unless otherwise specified, produces undefined behavior. |
657 virtual void OnInitializationComplete() = 0; | 657 virtual void OnInitializationComplete() = 0; |
658 | 658 |
659 // The syncer thread has been paused. | 659 // The syncer thread has been paused. |
660 virtual void OnPaused() = 0; | 660 virtual void OnPaused() = 0; |
661 | 661 |
662 // The syncer thread has been resumed. | 662 // The syncer thread has been resumed. |
663 virtual void OnResumed() = 0; | 663 virtual void OnResumed() = 0; |
664 | 664 |
| 665 // We are no longer permitted to communicate with the server. Sync should |
| 666 // be disabled and state cleaned up at once. This can happen for a number |
| 667 // of reasons, e.g. swapping from a test instance to production, or a |
| 668 // global stop syncing operation has wiped the store. |
| 669 virtual void OnStopSyncingPermanently() = 0; |
| 670 |
665 private: | 671 private: |
666 DISALLOW_COPY_AND_ASSIGN(Observer); | 672 DISALLOW_COPY_AND_ASSIGN(Observer); |
667 }; | 673 }; |
668 | 674 |
669 // Create an uninitialized SyncManager. Callers must Init() before using. | 675 // Create an uninitialized SyncManager. Callers must Init() before using. |
670 SyncManager(); | 676 SyncManager(); |
671 virtual ~SyncManager(); | 677 virtual ~SyncManager(); |
672 | 678 |
673 // Initialize the sync manager. |database_location| specifies the path of | 679 // Initialize the sync manager. |database_location| specifies the path of |
674 // the directory in which to locate a sqlite repository storing the syncer | 680 // the directory in which to locate a sqlite repository storing the syncer |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 // This allows actual HttpPostProvider subclass implementations to be | 880 // This allows actual HttpPostProvider subclass implementations to be |
875 // reference counted, which is useful if a particular implementation uses | 881 // reference counted, which is useful if a particular implementation uses |
876 // multiple threads to serve network requests. | 882 // multiple threads to serve network requests. |
877 virtual void Destroy(HttpPostProviderInterface* http) = 0; | 883 virtual void Destroy(HttpPostProviderInterface* http) = 0; |
878 virtual ~HttpPostProviderFactory() { } | 884 virtual ~HttpPostProviderFactory() { } |
879 }; | 885 }; |
880 | 886 |
881 } // namespace sync_api | 887 } // namespace sync_api |
882 | 888 |
883 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 889 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |