OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ |
6 #define SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ | 6 #define SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Most of other functions are no ops. | 29 // Most of other functions are no ops. |
30 class SYNC_EXPORT_PRIVATE SyncRollbackManagerBase : | 30 class SYNC_EXPORT_PRIVATE SyncRollbackManagerBase : |
31 public SyncManager, | 31 public SyncManager, |
32 public syncable::DirectoryChangeDelegate, | 32 public syncable::DirectoryChangeDelegate, |
33 public syncable::TransactionObserver { | 33 public syncable::TransactionObserver { |
34 public: | 34 public: |
35 SyncRollbackManagerBase(); | 35 SyncRollbackManagerBase(); |
36 virtual ~SyncRollbackManagerBase(); | 36 virtual ~SyncRollbackManagerBase(); |
37 | 37 |
38 // SyncManager implementation. | 38 // SyncManager implementation. |
39 virtual ModelTypeSet InitialSyncEndedTypes() OVERRIDE; | 39 virtual ModelTypeSet InitialSyncEndedTypes() override; |
40 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( | 40 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( |
41 ModelTypeSet types) OVERRIDE; | 41 ModelTypeSet types) override; |
42 virtual bool PurgePartiallySyncedTypes() OVERRIDE; | 42 virtual bool PurgePartiallySyncedTypes() override; |
43 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; | 43 virtual void UpdateCredentials(const SyncCredentials& credentials) override; |
44 virtual void StartSyncingNormally(const ModelSafeRoutingInfo& routing_info) | 44 virtual void StartSyncingNormally(const ModelSafeRoutingInfo& routing_info) |
45 OVERRIDE; | 45 override; |
46 virtual void ConfigureSyncer( | 46 virtual void ConfigureSyncer( |
47 ConfigureReason reason, | 47 ConfigureReason reason, |
48 ModelTypeSet to_download, | 48 ModelTypeSet to_download, |
49 ModelTypeSet to_purge, | 49 ModelTypeSet to_purge, |
50 ModelTypeSet to_journal, | 50 ModelTypeSet to_journal, |
51 ModelTypeSet to_unapply, | 51 ModelTypeSet to_unapply, |
52 const ModelSafeRoutingInfo& new_routing_info, | 52 const ModelSafeRoutingInfo& new_routing_info, |
53 const base::Closure& ready_task, | 53 const base::Closure& ready_task, |
54 const base::Closure& retry_task) OVERRIDE; | 54 const base::Closure& retry_task) override; |
55 virtual void SetInvalidatorEnabled(bool invalidator_enabled) OVERRIDE; | 55 virtual void SetInvalidatorEnabled(bool invalidator_enabled) override; |
56 virtual void OnIncomingInvalidation( | 56 virtual void OnIncomingInvalidation( |
57 syncer::ModelType type, | 57 syncer::ModelType type, |
58 scoped_ptr<InvalidationInterface> invalidation) OVERRIDE; | 58 scoped_ptr<InvalidationInterface> invalidation) override; |
59 virtual void AddObserver(SyncManager::Observer* observer) OVERRIDE; | 59 virtual void AddObserver(SyncManager::Observer* observer) override; |
60 virtual void RemoveObserver(SyncManager::Observer* observer) OVERRIDE; | 60 virtual void RemoveObserver(SyncManager::Observer* observer) override; |
61 virtual SyncStatus GetDetailedStatus() const OVERRIDE; | 61 virtual SyncStatus GetDetailedStatus() const override; |
62 virtual void SaveChanges() OVERRIDE; | 62 virtual void SaveChanges() override; |
63 virtual void ShutdownOnSyncThread(ShutdownReason reason) OVERRIDE; | 63 virtual void ShutdownOnSyncThread(ShutdownReason reason) override; |
64 virtual UserShare* GetUserShare() OVERRIDE; | 64 virtual UserShare* GetUserShare() override; |
65 virtual const std::string cache_guid() OVERRIDE; | 65 virtual const std::string cache_guid() override; |
66 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; | 66 virtual bool ReceivedExperiment(Experiments* experiments) override; |
67 virtual bool HasUnsyncedItems() OVERRIDE; | 67 virtual bool HasUnsyncedItems() override; |
68 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; | 68 virtual SyncEncryptionHandler* GetEncryptionHandler() override; |
69 virtual void RefreshTypes(ModelTypeSet types) OVERRIDE; | 69 virtual void RefreshTypes(ModelTypeSet types) override; |
70 virtual SyncContextProxy* GetSyncContextProxy() OVERRIDE; | 70 virtual SyncContextProxy* GetSyncContextProxy() override; |
71 virtual ScopedVector<ProtocolEvent> GetBufferedProtocolEvents() | 71 virtual ScopedVector<ProtocolEvent> GetBufferedProtocolEvents() |
72 OVERRIDE; | 72 override; |
73 virtual scoped_ptr<base::ListValue> GetAllNodesForType( | 73 virtual scoped_ptr<base::ListValue> GetAllNodesForType( |
74 syncer::ModelType type) OVERRIDE; | 74 syncer::ModelType type) override; |
75 | 75 |
76 // DirectoryChangeDelegate implementation. | 76 // DirectoryChangeDelegate implementation. |
77 virtual void HandleTransactionCompleteChangeEvent( | 77 virtual void HandleTransactionCompleteChangeEvent( |
78 ModelTypeSet models_with_changes) OVERRIDE; | 78 ModelTypeSet models_with_changes) override; |
79 virtual ModelTypeSet HandleTransactionEndingChangeEvent( | 79 virtual ModelTypeSet HandleTransactionEndingChangeEvent( |
80 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 80 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
81 syncable::BaseTransaction* trans) OVERRIDE; | 81 syncable::BaseTransaction* trans) override; |
82 virtual void HandleCalculateChangesChangeEventFromSyncApi( | 82 virtual void HandleCalculateChangesChangeEventFromSyncApi( |
83 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 83 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
84 syncable::BaseTransaction* trans, | 84 syncable::BaseTransaction* trans, |
85 std::vector<int64>* entries_changed) OVERRIDE; | 85 std::vector<int64>* entries_changed) override; |
86 virtual void HandleCalculateChangesChangeEventFromSyncer( | 86 virtual void HandleCalculateChangesChangeEventFromSyncer( |
87 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 87 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
88 syncable::BaseTransaction* trans, | 88 syncable::BaseTransaction* trans, |
89 std::vector<int64>* entries_changed) OVERRIDE; | 89 std::vector<int64>* entries_changed) override; |
90 | 90 |
91 // syncable::TransactionObserver implementation. | 91 // syncable::TransactionObserver implementation. |
92 virtual void OnTransactionWrite( | 92 virtual void OnTransactionWrite( |
93 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 93 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
94 ModelTypeSet models_with_changes) OVERRIDE; | 94 ModelTypeSet models_with_changes) override; |
95 | 95 |
96 protected: | 96 protected: |
97 ObserverList<SyncManager::Observer>* GetObservers(); | 97 ObserverList<SyncManager::Observer>* GetObservers(); |
98 | 98 |
99 // Initialize sync backup DB. | 99 // Initialize sync backup DB. |
100 bool InitInternal( | 100 bool InitInternal( |
101 const base::FilePath& database_location, | 101 const base::FilePath& database_location, |
102 InternalComponentsFactory* internal_components_factory, | 102 InternalComponentsFactory* internal_components_factory, |
103 InternalComponentsFactory::StorageOption storage, | 103 InternalComponentsFactory::StorageOption storage, |
104 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, | 104 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, |
105 ReportUnrecoverableErrorFunction report_unrecoverable_error_function); | 105 ReportUnrecoverableErrorFunction report_unrecoverable_error_function); |
106 | 106 |
107 virtual void RegisterDirectoryTypeDebugInfoObserver( | 107 virtual void RegisterDirectoryTypeDebugInfoObserver( |
108 syncer::TypeDebugInfoObserver* observer) OVERRIDE; | 108 syncer::TypeDebugInfoObserver* observer) override; |
109 virtual void UnregisterDirectoryTypeDebugInfoObserver( | 109 virtual void UnregisterDirectoryTypeDebugInfoObserver( |
110 syncer::TypeDebugInfoObserver* observer) OVERRIDE; | 110 syncer::TypeDebugInfoObserver* observer) override; |
111 virtual bool HasDirectoryTypeDebugInfoObserver( | 111 virtual bool HasDirectoryTypeDebugInfoObserver( |
112 syncer::TypeDebugInfoObserver* observer) OVERRIDE; | 112 syncer::TypeDebugInfoObserver* observer) override; |
113 virtual void RequestEmitDebugInfo() OVERRIDE; | 113 virtual void RequestEmitDebugInfo() override; |
114 | 114 |
115 bool initialized() const { | 115 bool initialized() const { |
116 return initialized_; | 116 return initialized_; |
117 } | 117 } |
118 | 118 |
119 private: | 119 private: |
120 void NotifyInitializationSuccess(); | 120 void NotifyInitializationSuccess(); |
121 void NotifyInitializationFailure(); | 121 void NotifyInitializationFailure(); |
122 | 122 |
123 bool InitBackupDB(const base::FilePath& sync_folder, | 123 bool InitBackupDB(const base::FilePath& sync_folder, |
(...skipping 14 matching lines...) Expand all Loading... |
138 bool initialized_; | 138 bool initialized_; |
139 | 139 |
140 base::WeakPtrFactory<SyncRollbackManagerBase> weak_ptr_factory_; | 140 base::WeakPtrFactory<SyncRollbackManagerBase> weak_ptr_factory_; |
141 | 141 |
142 DISALLOW_COPY_AND_ASSIGN(SyncRollbackManagerBase); | 142 DISALLOW_COPY_AND_ASSIGN(SyncRollbackManagerBase); |
143 }; | 143 }; |
144 | 144 |
145 } // namespace syncer | 145 } // namespace syncer |
146 | 146 |
147 #endif // SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ | 147 #endif // SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ |
OLD | NEW |