| 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_CORE_SYNC_MANAGER_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_SYNC_MANAGER_H_ |
| 6 #define COMPONENTS_SYNC_CORE_SYNC_MANAGER_H_ | 6 #define COMPONENTS_SYNC_CORE_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_vector.h" | |
| 18 #include "base/task_runner.h" | 17 #include "base/task_runner.h" |
| 19 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 20 #include "components/sync/base/invalidation_interface.h" | 19 #include "components/sync/base/invalidation_interface.h" |
| 21 #include "components/sync/base/model_type.h" | 20 #include "components/sync/base/model_type.h" |
| 22 #include "components/sync/base/weak_handle.h" | 21 #include "components/sync/base/weak_handle.h" |
| 23 #include "components/sync/core/change_record.h" | 22 #include "components/sync/core/change_record.h" |
| 24 #include "components/sync/core/configure_reason.h" | 23 #include "components/sync/core/configure_reason.h" |
| 25 #include "components/sync/core/connection_status.h" | 24 #include "components/sync/core/connection_status.h" |
| 26 #include "components/sync/core/http_post_provider_factory.h" | 25 #include "components/sync/core/http_post_provider_factory.h" |
| 27 #include "components/sync/core/internal_components_factory.h" | 26 #include "components/sync/core/internal_components_factory.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // Returns the SyncManager's encryption handler. | 366 // Returns the SyncManager's encryption handler. |
| 368 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 367 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
| 369 | 368 |
| 370 virtual std::unique_ptr<base::ListValue> GetAllNodesForType( | 369 virtual std::unique_ptr<base::ListValue> GetAllNodesForType( |
| 371 syncer::ModelType type) = 0; | 370 syncer::ModelType type) = 0; |
| 372 | 371 |
| 373 // Ask the SyncManager to fetch updates for the given types. | 372 // Ask the SyncManager to fetch updates for the given types. |
| 374 virtual void RefreshTypes(ModelTypeSet types) = 0; | 373 virtual void RefreshTypes(ModelTypeSet types) = 0; |
| 375 | 374 |
| 376 // Returns any buffered protocol events. Does not clear the buffer. | 375 // Returns any buffered protocol events. Does not clear the buffer. |
| 377 virtual ScopedVector<syncer::ProtocolEvent> GetBufferedProtocolEvents() = 0; | 376 virtual std::vector<std::unique_ptr<ProtocolEvent>> |
| 377 GetBufferedProtocolEvents() = 0; |
| 378 | 378 |
| 379 // Functions to manage registrations of DebugInfoObservers. | 379 // Functions to manage registrations of DebugInfoObservers. |
| 380 virtual void RegisterDirectoryTypeDebugInfoObserver( | 380 virtual void RegisterDirectoryTypeDebugInfoObserver( |
| 381 syncer::TypeDebugInfoObserver* observer) = 0; | 381 syncer::TypeDebugInfoObserver* observer) = 0; |
| 382 virtual void UnregisterDirectoryTypeDebugInfoObserver( | 382 virtual void UnregisterDirectoryTypeDebugInfoObserver( |
| 383 syncer::TypeDebugInfoObserver* observer) = 0; | 383 syncer::TypeDebugInfoObserver* observer) = 0; |
| 384 virtual bool HasDirectoryTypeDebugInfoObserver( | 384 virtual bool HasDirectoryTypeDebugInfoObserver( |
| 385 syncer::TypeDebugInfoObserver* observer) = 0; | 385 syncer::TypeDebugInfoObserver* observer) = 0; |
| 386 | 386 |
| 387 // Request that all current counter values be emitted as though they had just | 387 // Request that all current counter values be emitted as though they had just |
| 388 // been updated. Useful for initializing new observers' state. | 388 // been updated. Useful for initializing new observers' state. |
| 389 virtual void RequestEmitDebugInfo() = 0; | 389 virtual void RequestEmitDebugInfo() = 0; |
| 390 | 390 |
| 391 // Clears server data and invokes |callback| when complete. | 391 // Clears server data and invokes |callback| when complete. |
| 392 // | 392 // |
| 393 // This is an asynchronous operation that requires interaction with the sync | 393 // This is an asynchronous operation that requires interaction with the sync |
| 394 // server. The operation will automatically be retried with backoff until it | 394 // server. The operation will automatically be retried with backoff until it |
| 395 // completes successfully or sync is shutdown. | 395 // completes successfully or sync is shutdown. |
| 396 virtual void ClearServerData(const ClearServerDataCallback& callback) = 0; | 396 virtual void ClearServerData(const ClearServerDataCallback& callback) = 0; |
| 397 | 397 |
| 398 // Updates Sync's tracking of whether the cookie jar has a mismatch with the | 398 // Updates Sync's tracking of whether the cookie jar has a mismatch with the |
| 399 // chrome account. See ClientConfigParams proto message for more info. | 399 // chrome account. See ClientConfigParams proto message for more info. |
| 400 // Note: this does not trigger a sync cycle. It just updates the sync context. | 400 // Note: this does not trigger a sync cycle. It just updates the sync context. |
| 401 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; | 401 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 } // namespace syncer | 404 } // namespace syncer |
| 405 | 405 |
| 406 #endif // COMPONENTS_SYNC_CORE_SYNC_MANAGER_H_ | 406 #endif // COMPONENTS_SYNC_CORE_SYNC_MANAGER_H_ |
| OLD | NEW |