Chromium Code Reviews| 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 SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/task_runner.h" | 15 #include "base/task_runner.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "sync/internal_api/public/base/model_type.h" | 18 #include "sync/internal_api/public/base/model_type.h" |
| 19 #include "sync/internal_api/public/change_record.h" | 19 #include "sync/internal_api/public/change_record.h" |
| 20 #include "sync/internal_api/public/configure_reason.h" | 20 #include "sync/internal_api/public/configure_reason.h" |
| 21 #include "sync/internal_api/public/engine/model_safe_worker.h" | 21 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 22 #include "sync/internal_api/public/engine/sync_status.h" | 22 #include "sync/internal_api/public/engine/sync_status.h" |
| 23 #include "sync/internal_api/public/internal_components_factory.h" | |
|
Nicolas Zea
2012/07/18 21:10:12
forward declare?
tim (not reviewing)
2012/07/18 21:57:47
Done.
| |
| 23 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" | 24 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" |
| 24 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 25 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
|
Nicolas Zea
2012/07/18 21:10:12
this can be forward declared too I think
tim (not reviewing)
2012/07/18 21:57:47
Done.
| |
| 25 #include "sync/internal_api/public/util/weak_handle.h" | 26 #include "sync/internal_api/public/util/weak_handle.h" |
| 26 #include "sync/protocol/sync_protocol_error.h" | 27 #include "sync/protocol/sync_protocol_error.h" |
| 27 | 28 |
| 28 namespace syncer { | 29 namespace syncer { |
| 29 class Encryptor; | 30 class Encryptor; |
| 30 struct Experiments; | 31 struct Experiments; |
| 31 class ExtensionsActivityMonitor; | 32 class ExtensionsActivityMonitor; |
| 32 class JsBackend; | 33 class JsBackend; |
| 33 class JsEventHandler; | 34 class JsEventHandler; |
| 34 class SyncScheduler; | 35 class SyncScheduler; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 // Called from within a transaction. | 335 // Called from within a transaction. |
| 335 virtual void OnEncryptionComplete() = 0; | 336 virtual void OnEncryptionComplete() = 0; |
| 336 | 337 |
| 337 virtual void OnActionableError( | 338 virtual void OnActionableError( |
| 338 const syncer::SyncProtocolError& sync_protocol_error) = 0; | 339 const syncer::SyncProtocolError& sync_protocol_error) = 0; |
| 339 | 340 |
| 340 protected: | 341 protected: |
| 341 virtual ~Observer(); | 342 virtual ~Observer(); |
| 342 }; | 343 }; |
| 343 | 344 |
| 344 enum TestingMode { | |
| 345 NON_TEST, | |
| 346 TEST_ON_DISK, | |
| 347 TEST_IN_MEMORY, | |
| 348 }; | |
| 349 | |
| 350 // Create an uninitialized SyncManager. Callers must Init() before using. | 345 // Create an uninitialized SyncManager. Callers must Init() before using. |
| 351 explicit SyncManager(const std::string& name); | 346 explicit SyncManager(const std::string& name); |
| 352 virtual ~SyncManager(); | 347 virtual ~SyncManager(); |
| 353 | 348 |
| 354 // Initialize the sync manager. |database_location| specifies the path of | 349 // Initialize the sync manager. |database_location| specifies the path of |
| 355 // the directory in which to locate a sqlite repository storing the syncer | 350 // the directory in which to locate a sqlite repository storing the syncer |
| 356 // backend state. Initialization will open the database, or create it if it | 351 // backend state. Initialization will open the database, or create it if it |
| 357 // does not already exist. Returns false on failure. | 352 // does not already exist. Returns false on failure. |
| 358 // |event_handler| is the JsEventHandler used to propagate events to | 353 // |event_handler| is the JsEventHandler used to propagate events to |
| 359 // chrome://sync-internals. |event_handler| may be uninitialized. | 354 // chrome://sync-internals. |event_handler| may be uninitialized. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 381 const scoped_refptr<base::TaskRunner>& blocking_task_runner, | 376 const scoped_refptr<base::TaskRunner>& blocking_task_runner, |
| 382 HttpPostProviderFactory* post_factory, | 377 HttpPostProviderFactory* post_factory, |
| 383 const syncer::ModelSafeRoutingInfo& model_safe_routing_info, | 378 const syncer::ModelSafeRoutingInfo& model_safe_routing_info, |
| 384 const std::vector<syncer::ModelSafeWorker*>& workers, | 379 const std::vector<syncer::ModelSafeWorker*>& workers, |
| 385 syncer::ExtensionsActivityMonitor* | 380 syncer::ExtensionsActivityMonitor* |
| 386 extensions_activity_monitor, | 381 extensions_activity_monitor, |
| 387 ChangeDelegate* change_delegate, | 382 ChangeDelegate* change_delegate, |
| 388 const SyncCredentials& credentials, | 383 const SyncCredentials& credentials, |
| 389 syncer::SyncNotifier* sync_notifier, | 384 syncer::SyncNotifier* sync_notifier, |
| 390 const std::string& restored_key_for_bootstrapping, | 385 const std::string& restored_key_for_bootstrapping, |
| 391 TestingMode testing_mode, | 386 scoped_ptr<InternalComponentsFactory> internal_components_factory, |
| 392 syncer::Encryptor* encryptor, | 387 syncer::Encryptor* encryptor, |
| 393 syncer::UnrecoverableErrorHandler* | 388 syncer::UnrecoverableErrorHandler* |
| 394 unrecoverable_error_handler, | 389 unrecoverable_error_handler, |
| 395 syncer::ReportUnrecoverableErrorFunction | 390 syncer::ReportUnrecoverableErrorFunction |
| 396 report_unrecoverable_error_function); | 391 report_unrecoverable_error_function); |
| 397 | 392 |
| 398 // Throw an unrecoverable error from a transaction (mostly used for | 393 // Throw an unrecoverable error from a transaction (mostly used for |
| 399 // testing). | 394 // testing). |
| 400 void ThrowUnrecoverableError(); | 395 void ThrowUnrecoverableError(); |
| 401 | 396 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 bool InitialSyncEndedForTypes(syncer::ModelTypeSet types, UserShare* share); | 566 bool InitialSyncEndedForTypes(syncer::ModelTypeSet types, UserShare* share); |
| 572 | 567 |
| 573 const char* ConnectionStatusToString(ConnectionStatus status); | 568 const char* ConnectionStatusToString(ConnectionStatus status); |
| 574 | 569 |
| 575 // Returns the string representation of a PassphraseRequiredReason value. | 570 // Returns the string representation of a PassphraseRequiredReason value. |
| 576 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason); | 571 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason); |
| 577 | 572 |
| 578 } // namespace syncer | 573 } // namespace syncer |
| 579 | 574 |
| 580 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 575 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| OLD | NEW |