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_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 void RefreshSpareBootstrapToken(const std::string& passphrase); | 708 void RefreshSpareBootstrapToken(const std::string& passphrase); |
709 #endif | 709 #endif |
710 | 710 |
711 // Internal unrecoverable error handler. Used to track error reason via | 711 // Internal unrecoverable error handler. Used to track error reason via |
712 // Sync.UnrecoverableErrors histogram. | 712 // Sync.UnrecoverableErrors histogram. |
713 void OnInternalUnrecoverableError(const tracked_objects::Location& from_here, | 713 void OnInternalUnrecoverableError(const tracked_objects::Location& from_here, |
714 const std::string& message, | 714 const std::string& message, |
715 bool delete_sync_database, | 715 bool delete_sync_database, |
716 UnrecoverableErrorReason reason); | 716 UnrecoverableErrorReason reason); |
717 | 717 |
| 718 // Must be called every time |backend_initialized_| or |
| 719 // |invalidator_state_| is changed (but only if |
| 720 // |invalidator_registrar_| is not NULL). |
| 721 void UpdateInvalidatorRegistrarState(); |
| 722 |
718 // Destroys / recreates an instance of ProfileSyncService. Used exclusively by | 723 // Destroys / recreates an instance of ProfileSyncService. Used exclusively by |
719 // the sync integration tests so they can restart sync from scratch without | 724 // the sync integration tests so they can restart sync from scratch without |
720 // tearing down and recreating the browser process. Needed because simply | 725 // tearing down and recreating the browser process. Needed because simply |
721 // calling Shutdown() and Initialize() will not recreate other internal | 726 // calling Shutdown() and Initialize() will not recreate other internal |
722 // objects like SyncBackendHost, SyncManager, etc. | 727 // objects like SyncBackendHost, SyncManager, etc. |
723 void ResetForTest(); | 728 void ResetForTest(); |
724 | 729 |
725 // Factory used to create various dependent objects. | 730 // Factory used to create various dependent objects. |
726 scoped_ptr<ProfileSyncComponentsFactory> factory_; | 731 scoped_ptr<ProfileSyncComponentsFactory> factory_; |
727 | 732 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 // If |true|, there is setup UI visible so we should not start downloading | 841 // If |true|, there is setup UI visible so we should not start downloading |
837 // data types. | 842 // data types. |
838 bool setup_in_progress_; | 843 bool setup_in_progress_; |
839 | 844 |
840 // The set of currently enabled sync experiments. | 845 // The set of currently enabled sync experiments. |
841 syncer::Experiments current_experiments; | 846 syncer::Experiments current_experiments; |
842 | 847 |
843 // Factory the backend will use to build the SyncManager. | 848 // Factory the backend will use to build the SyncManager. |
844 syncer::SyncManagerFactory sync_manager_factory_; | 849 syncer::SyncManagerFactory sync_manager_factory_; |
845 | 850 |
| 851 // Holds the current invalidator state as updated by |
| 852 // OnInvalidatorStateChange(). Note that this is different from the |
| 853 // state known by |invalidator_registrar_| (See |
| 854 // UpdateInvalidatorState()). |
| 855 syncer::InvalidatorState invalidator_state_; |
| 856 |
846 // Dispatches invalidations to handlers. Set in Initialize() and | 857 // Dispatches invalidations to handlers. Set in Initialize() and |
847 // unset in Shutdown(). | 858 // unset in Shutdown(). |
848 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; | 859 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; |
849 | 860 |
850 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 861 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
851 }; | 862 }; |
852 | 863 |
853 bool ShouldShowActionOnUI( | 864 bool ShouldShowActionOnUI( |
854 const syncer::SyncProtocolError& error); | 865 const syncer::SyncProtocolError& error); |
855 | 866 |
856 | 867 |
857 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 868 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |