| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 virtual ModelTypeSet InitialSyncEndedTypes() = 0; | 283 virtual ModelTypeSet InitialSyncEndedTypes() = 0; |
| 284 | 284 |
| 285 // Returns those types within |types| that have an empty progress marker | 285 // Returns those types within |types| that have an empty progress marker |
| 286 // token. | 286 // token. |
| 287 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( | 287 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( |
| 288 ModelTypeSet types) = 0; | 288 ModelTypeSet types) = 0; |
| 289 | 289 |
| 290 // Purge from the directory those types with non-empty progress markers | 290 // Purge from the directory those types with non-empty progress markers |
| 291 // but without initial synced ended set. | 291 // but without initial synced ended set. |
| 292 // Returns false if an error occurred, true otherwise. | 292 // Returns false if an error occurred, true otherwise. |
| 293 virtual bool PurgePartiallySyncedTypes() = 0; | 293 virtual void PurgePartiallySyncedTypes() = 0; |
| 294 |
| 295 // Purge those disabled types as specified by |to_purge|. |to_journal| and |
| 296 // |to_unapply| specify subsets that require special handling. |to_journal| |
| 297 // types are saved into the delete journal, while |to_unapply| have only |
| 298 // their local data deleted, while their server data is preserved. |
| 299 virtual void PurgeDisabledTypes(ModelTypeSet to_purge, |
| 300 ModelTypeSet to_journal, |
| 301 ModelTypeSet to_unapply) = 0; |
| 294 | 302 |
| 295 // Update tokens that we're using in Sync. Email must stay the same. | 303 // Update tokens that we're using in Sync. Email must stay the same. |
| 296 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; | 304 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; |
| 297 | 305 |
| 298 // Put the syncer in normal mode ready to perform nudges and polls. | 306 // Put the syncer in normal mode ready to perform nudges and polls. |
| 299 virtual void StartSyncingNormally(const ModelSafeRoutingInfo& routing_info, | 307 virtual void StartSyncingNormally(const ModelSafeRoutingInfo& routing_info, |
| 300 base::Time last_poll_time) = 0; | 308 base::Time last_poll_time) = 0; |
| 301 | 309 |
| 302 // Switches the mode of operation to CONFIGURATION_MODE and performs | 310 // Switches the mode of operation to CONFIGURATION_MODE and performs |
| 303 // any configuration tasks needed as determined by the params. Once complete, | 311 // any configuration tasks needed as determined by the params. Once complete, |
| 304 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is | 312 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is |
| 305 // called. | 313 // called. |
| 306 // Data whose types are not in |new_routing_info| are purged from sync | |
| 307 // directory, unless they're part of |to_ignore|, in which case they're left | |
| 308 // untouched. The purged data is backed up in delete journal for recovery in | |
| 309 // next session if its type is in |to_journal|. If in |to_unapply| | |
| 310 // only the local data is removed; the server data is preserved. | |
| 311 // |ready_task| is invoked when the configuration completes. | 314 // |ready_task| is invoked when the configuration completes. |
| 312 // |retry_task| is invoked if the configuration job could not immediately | 315 // |retry_task| is invoked if the configuration job could not immediately |
| 313 // execute. |ready_task| will still be called when it eventually | 316 // execute. |ready_task| will still be called when it eventually |
| 314 // does finish. | 317 // does finish. |
| 315 virtual void ConfigureSyncer(ConfigureReason reason, | 318 virtual void ConfigureSyncer(ConfigureReason reason, |
| 316 ModelTypeSet to_download, | 319 ModelTypeSet to_download, |
| 317 ModelTypeSet to_purge, | |
| 318 ModelTypeSet to_journal, | |
| 319 ModelTypeSet to_unapply, | |
| 320 const ModelSafeRoutingInfo& new_routing_info, | 320 const ModelSafeRoutingInfo& new_routing_info, |
| 321 const base::Closure& ready_task, | 321 const base::Closure& ready_task, |
| 322 const base::Closure& retry_task) = 0; | 322 const base::Closure& retry_task) = 0; |
| 323 | 323 |
| 324 // Inform the syncer of a change in the invalidator's state. | 324 // Inform the syncer of a change in the invalidator's state. |
| 325 virtual void SetInvalidatorEnabled(bool invalidator_enabled) = 0; | 325 virtual void SetInvalidatorEnabled(bool invalidator_enabled) = 0; |
| 326 | 326 |
| 327 // Inform the syncer that its cached information about a type is obsolete. | 327 // Inform the syncer that its cached information about a type is obsolete. |
| 328 virtual void OnIncomingInvalidation( | 328 virtual void OnIncomingInvalidation( |
| 329 ModelType type, | 329 ModelType type, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // Note: this does not trigger a sync cycle. It just updates the sync context. | 402 // Note: this does not trigger a sync cycle. It just updates the sync context. |
| 403 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; | 403 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; |
| 404 | 404 |
| 405 // Adds memory usage statistics to |pmd| for chrome://tracing. | 405 // Adds memory usage statistics to |pmd| for chrome://tracing. |
| 406 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0; | 406 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0; |
| 407 }; | 407 }; |
| 408 | 408 |
| 409 } // namespace syncer | 409 } // namespace syncer |
| 410 | 410 |
| 411 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ | 411 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ |
| OLD | NEW |