Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1528)

Unified Diff: sync/internal_api/public/sync_manager.h

Issue 10701085: Revert "Revert 142517 - [Sync] Refactor sync configuration logic." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile/test Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sync/internal_api/public/sync_manager.h
diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h
index bb8dd619e6a5df50d425a02cbf06c35b975a4c06..bafec90aefbb47d478a02acfb917a7b81e4c2f87 100644
--- a/sync/internal_api/public/sync_manager.h
+++ b/sync/internal_api/public/sync_manager.h
@@ -372,41 +372,43 @@ class SyncManager {
//
// TODO(akalin): Replace the |post_factory| parameter with a
// URLFetcher parameter.
- bool Init(const FilePath& database_location,
- const syncer::WeakHandle<syncer::JsEventHandler>&
- event_handler,
- const std::string& sync_server_and_path,
- int sync_server_port,
- bool use_ssl,
- const scoped_refptr<base::TaskRunner>& blocking_task_runner,
- HttpPostProviderFactory* post_factory,
- const syncer::ModelSafeRoutingInfo& model_safe_routing_info,
- const std::vector<syncer::ModelSafeWorker*>& workers,
- syncer::ExtensionsActivityMonitor*
- extensions_activity_monitor,
- ChangeDelegate* change_delegate,
- const SyncCredentials& credentials,
- syncer::SyncNotifier* sync_notifier,
- const std::string& restored_key_for_bootstrapping,
- TestingMode testing_mode,
- syncer::Encryptor* encryptor,
- syncer::UnrecoverableErrorHandler*
- unrecoverable_error_handler,
- syncer::ReportUnrecoverableErrorFunction
- report_unrecoverable_error_function);
+ virtual bool Init(
+ const FilePath& database_location,
+ const syncer::WeakHandle<syncer::JsEventHandler>& event_handler,
+ const std::string& sync_server_and_path,
+ int sync_server_port,
+ bool use_ssl,
+ const scoped_refptr<base::TaskRunner>& blocking_task_runner,
+ scoped_ptr<HttpPostProviderFactory> post_factory,
+ const syncer::ModelSafeRoutingInfo& model_safe_routing_info,
+ const std::vector<syncer::ModelSafeWorker*>& workers,
+ syncer::ExtensionsActivityMonitor* extensions_activity_monitor,
+ ChangeDelegate* change_delegate,
+ const SyncCredentials& credentials,
+ scoped_ptr<syncer::SyncNotifier> sync_notifier,
+ const std::string& restored_key_for_bootstrapping,
+ TestingMode testing_mode,
+ syncer::Encryptor* encryptor,
+ syncer::UnrecoverableErrorHandler* unrecoverable_error_handler,
+ syncer::ReportUnrecoverableErrorFunction
+ report_unrecoverable_error_function);
// Throw an unrecoverable error from a transaction (mostly used for
// testing).
void ThrowUnrecoverableError();
- // Returns the set of types for which we have stored some sync data.
- syncer::ModelTypeSet InitialSyncEndedTypes();
+ virtual syncer::ModelTypeSet InitialSyncEndedTypes();
+
+ // Returns those types within |types| that have an empty progress marker
+ // token.
+ virtual syncer::ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
+ syncer::ModelTypeSet types);
// Update tokens that we're using in Sync. Email must stay the same.
void UpdateCredentials(const SyncCredentials& credentials);
// Called when the user disables or enables a sync type.
- void UpdateEnabledTypes(const syncer::ModelTypeSet& enabled_types);
+ virtual void UpdateEnabledTypes(const syncer::ModelTypeSet& enabled_types);
// Put the syncer in normal mode ready to perform nudges and polls.
void StartSyncingNormally(
@@ -437,7 +439,7 @@ class SyncManager {
// |retry_task| is invoked if the configuration job could not immediately
// execute. |ready_task| will still be called when it eventually
// does finish.
- void ConfigureSyncer(
+ virtual void ConfigureSyncer(
ConfigureReason reason,
const syncer::ModelTypeSet& types_to_config,
const syncer::ModelSafeRoutingInfo& new_routing_info,
@@ -447,12 +449,12 @@ class SyncManager {
// Adds a listener to be notified of sync events.
// NOTE: It is OK (in fact, it's probably a good idea) to call this before
// having received OnInitializationCompleted.
- void AddObserver(Observer* observer);
+ virtual void AddObserver(Observer* observer);
// Remove the given observer. Make sure to call this if the
// Observer is being destroyed so the SyncManager doesn't
// potentially dereference garbage.
- void RemoveObserver(Observer* observer);
+ virtual void RemoveObserver(Observer* observer);
// Status-related getter. May be called on any thread.
SyncStatus GetDetailedStatus() const;
@@ -477,7 +479,7 @@ class SyncManager {
void StopSyncingForShutdown(const base::Closure& callback);
// Issue a final SaveChanges, and close sqlite handles.
- void ShutdownOnSyncThread();
+ virtual void ShutdownOnSyncThread();
// May be called from any thread.
UserShare* GetUserShare() const;
@@ -494,8 +496,8 @@ class SyncManager {
//
// Note: opens a transaction, so must only be called after syncapi
// has been initialized.
- void RefreshNigori(const std::string& chrome_version,
- const base::Closure& done_callback);
+ virtual void RefreshNigori(const std::string& chrome_version,
+ const base::Closure& done_callback);
// Enable encryption of all sync data. Once enabled, it can never be
// disabled without clearing the server data.
@@ -517,7 +519,7 @@ class SyncManager {
// Reads the nigori node to determine if any experimental features should
// be enabled.
// Note: opens a transaction. May be called on any thread.
- bool ReceivedExperiment(syncer::Experiments* experiments) const;
+ virtual bool ReceivedExperiment(syncer::Experiments* experiments) const;
// Uses a read-only transaction to determine if the directory being synced has
// any remaining unsynced items. May be called on any thread.
@@ -560,10 +562,6 @@ class SyncManager {
bool InitialSyncEndedForTypes(syncer::ModelTypeSet types, UserShare* share);
-syncer::ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
- syncer::ModelTypeSet types,
- syncer::UserShare* share);
-
const char* ConnectionStatusToString(ConnectionStatus status);
// Returns the string representation of a PassphraseRequiredReason value.

Powered by Google App Engine
This is Rietveld 408576698