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

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

Issue 10689185: Revert 146262 - Revert "Revert 142517 - [Sync] Refactor sync configuration logic." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « sync/engine/sync_scheduler_whitebox_unittest.cc ('k') | sync/internal_api/sync_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/public/sync_manager.h
===================================================================
--- sync/internal_api/public/sync_manager.h (revision 146499)
+++ sync/internal_api/public/sync_manager.h (working copy)
@@ -31,7 +31,6 @@
class ExtensionsActivityMonitor;
class JsBackend;
class JsEventHandler;
-class SyncScheduler;
namespace sessions {
class SyncSessionSnapshot;
@@ -402,16 +401,6 @@
// 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,21 +428,21 @@
// 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
// having received OnInitializationCompleted.
@@ -549,17 +538,11 @@
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 @@
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.
« no previous file with comments | « sync/engine/sync_scheduler_whitebox_unittest.cc ('k') | sync/internal_api/sync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698