| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Carries shutdown requests across threads and will be used to cut short | 262 // Carries shutdown requests across threads and will be used to cut short |
| 263 // any network I/O and tell the syncer to exit early. | 263 // any network I/O and tell the syncer to exit early. |
| 264 // | 264 // |
| 265 // Must outlive SyncManager. | 265 // Must outlive SyncManager. |
| 266 CancelationSignal* cancelation_signal; | 266 CancelationSignal* cancelation_signal; |
| 267 | 267 |
| 268 // Optional nigori state to be restored. | 268 // Optional nigori state to be restored. |
| 269 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state; | 269 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state; |
| 270 }; | 270 }; |
| 271 | 271 |
| 272 using ClearServerDataCallback = base::Callback<void(void)>; | |
| 273 | |
| 274 SyncManager(); | 272 SyncManager(); |
| 275 virtual ~SyncManager(); | 273 virtual ~SyncManager(); |
| 276 | 274 |
| 277 // Initialize the sync manager using arguments from |args|. | 275 // Initialize the sync manager using arguments from |args|. |
| 278 // | 276 // |
| 279 // Note, args is passed by non-const pointer because it contains objects like | 277 // Note, args is passed by non-const pointer because it contains objects like |
| 280 // unique_ptr. | 278 // unique_ptr. |
| 281 virtual void Init(InitArgs* args) = 0; | 279 virtual void Init(InitArgs* args) = 0; |
| 282 | 280 |
| 283 virtual ModelTypeSet InitialSyncEndedTypes() = 0; | 281 virtual ModelTypeSet InitialSyncEndedTypes() = 0; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 394 |
| 397 // Request that all current counter values be emitted as though they had just | 395 // Request that all current counter values be emitted as though they had just |
| 398 // been updated. Useful for initializing new observers' state. | 396 // been updated. Useful for initializing new observers' state. |
| 399 virtual void RequestEmitDebugInfo() = 0; | 397 virtual void RequestEmitDebugInfo() = 0; |
| 400 | 398 |
| 401 // Clears server data and invokes |callback| when complete. | 399 // Clears server data and invokes |callback| when complete. |
| 402 // | 400 // |
| 403 // This is an asynchronous operation that requires interaction with the sync | 401 // This is an asynchronous operation that requires interaction with the sync |
| 404 // server. The operation will automatically be retried with backoff until it | 402 // server. The operation will automatically be retried with backoff until it |
| 405 // completes successfully or sync is shutdown. | 403 // completes successfully or sync is shutdown. |
| 406 virtual void ClearServerData(const ClearServerDataCallback& callback) = 0; | 404 virtual void ClearServerData(const base::Closure& callback) = 0; |
| 407 | 405 |
| 408 // Updates Sync's tracking of whether the cookie jar has a mismatch with the | 406 // Updates Sync's tracking of whether the cookie jar has a mismatch with the |
| 409 // chrome account. See ClientConfigParams proto message for more info. | 407 // chrome account. See ClientConfigParams proto message for more info. |
| 410 // Note: this does not trigger a sync cycle. It just updates the sync context. | 408 // Note: this does not trigger a sync cycle. It just updates the sync context. |
| 411 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; | 409 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; |
| 412 | 410 |
| 413 // Adds memory usage statistics to |pmd| for chrome://tracing. | 411 // Adds memory usage statistics to |pmd| for chrome://tracing. |
| 414 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0; | 412 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0; |
| 415 }; | 413 }; |
| 416 | 414 |
| 417 } // namespace syncer | 415 } // namespace syncer |
| 418 | 416 |
| 419 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ | 417 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ |
| OLD | NEW |