summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public/sync_manager.h
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 01:35:58 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 01:35:58 +0000
commit98a7b576b1e742d562667327962e81472a291db2 (patch)
tree5a5b25784bffe66c2bd9ead80c8160f7c379fa5d /sync/internal_api/public/sync_manager.h
parentc2f792c7555f76731169f46c407033cde523795b (diff)
downloadchromium_src-98a7b576b1e742d562667327962e81472a291db2.zip
chromium_src-98a7b576b1e742d562667327962e81472a291db2.tar.gz
chromium_src-98a7b576b1e742d562667327962e81472a291db2.tar.bz2
Revert 146262 - Revert "Revert 142517 - [Sync] Refactor sync configuration logic."
Relanding with improved tests and support for cleaning up partial nigori. The original patch was reverted due to users who needed to download a new nigori node, but who had since been migrated. We do not handle migration before the backend is initialized, so we now go ahead and detect+delete partial nigori nodes before redownloading them. By blowing away the old progress marker, we're no longer at risk of receiving the migration done response. In order to test this the SyncBackendHost unit tests have been substantially upgraded. original review at: https://chromiumcodereview.appspot.com/10483015 BUG=129665,133061,133219 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10701085 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10689185 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/public/sync_manager.h')
-rw-r--r--sync/internal_api/public/sync_manager.h49
1 files changed, 18 insertions, 31 deletions
diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h
index d31888c6..75e55aa 100644
--- a/sync/internal_api/public/sync_manager.h
+++ b/sync/internal_api/public/sync_manager.h
@@ -31,7 +31,6 @@ struct Experiments;
class ExtensionsActivityMonitor;
class JsBackend;
class JsEventHandler;
-class SyncScheduler;
namespace sessions {
class SyncSessionSnapshot;
@@ -402,16 +401,6 @@ class SyncManager {
// Returns the set of types for which we have stored some sync data.
syncer::ModelTypeSet InitialSyncEndedTypes();
- // Returns those types within |types| that have an empty progress marker
- // token.
- syncer::ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
- syncer::ModelTypeSet types);
-
- // Purge from the directory those types with non-empty progress markers
- // but without initial synced ended set.
- // Returns false if an error occurred, true otherwise.
- bool PurgePartiallySyncedTypes();
-
// Update tokens that we're using in Sync. Email must stay the same.
void UpdateCredentials(const SyncCredentials& credentials);
@@ -439,20 +428,20 @@ class SyncManager {
// error to call this when we don't have pending keys.
void SetDecryptionPassphrase(const std::string& passphrase);
- // Switches the mode of operation to CONFIGURATION_MODE and performs
- // any configuration tasks needed as determined by the params. Once complete,
- // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is
- // called.
- // |ready_task| is invoked when the configuration completes.
- // |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(
- ConfigureReason reason,
- const syncer::ModelTypeSet& types_to_config,
- const syncer::ModelSafeRoutingInfo& new_routing_info,
- const base::Closure& ready_task,
- const base::Closure& retry_task);
+ // Puts the SyncScheduler into a mode where no normal nudge or poll traffic
+ // will occur, but calls to RequestConfig will be supported. If |callback|
+ // is provided, it will be invoked (from the internal SyncScheduler) when
+ // the thread has changed to configuration mode.
+ void StartConfigurationMode(const base::Closure& callback);
+
+ // Switches the mode of operation to CONFIGURATION_MODE and
+ // schedules a config task to fetch updates for |types|.
+ void RequestConfig(const syncer::ModelSafeRoutingInfo& routing_info,
+ const syncer::ModelTypeSet& types,
+ syncer::ConfigureReason reason);
+
+ void RequestCleanupDisabledTypes(
+ const syncer::ModelSafeRoutingInfo& routing_info);
// 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
@@ -549,17 +538,11 @@ class SyncManager {
static const FilePath::CharType kSyncDatabaseFilename[];
private:
- friend class SyncManagerTest;
FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, NudgeDelayTest);
// For unit tests.
base::TimeDelta GetNudgeDelayTimeDelta(const syncer::ModelType& model_type);
- // Set the internal scheduler for testing purposes.
- // TODO(sync): Use dependency injection instead. crbug.com/133061
- void SetSyncSchedulerForTest(
- scoped_ptr<syncer::SyncScheduler> scheduler);
-
base::ThreadChecker thread_checker_;
// An opaque pointer to the nested private class.
@@ -570,6 +553,10 @@ 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.