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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 10704214: [Sync] Refactor sync manager into interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Comments 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
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index fca60be161f368638f194e8bbf6f89a54e474690..0a18af3637a429095de74b28260594c38555bb38 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -59,6 +59,7 @@
#include "sync/api/sync_error.h"
#include "sync/internal_api/public/configure_reason.h"
#include "sync/internal_api/public/util/experiments.h"
+#include "sync/internal_api/public/util/sync_string_conversions.h"
#include "sync/js/js_arg_list.h"
#include "sync/js/js_event_details.h"
#include "sync/util/cryptographer.h"
@@ -352,6 +353,7 @@ void ProfileSyncService::InitializeBackend(bool delete_stale_data) {
initial_types,
credentials,
delete_stale_data,
+ &sync_manager_factory_,
backend_unrecoverable_error_handler_.get(),
&browser_sync::ChromeReportUnrecoverableError);
}
@@ -1195,14 +1197,17 @@ void ProfileSyncService::ConfigureDataTypeManager() {
syncer::ConfigureReason reason = syncer::CONFIGURE_REASON_UNKNOWN;
if (!HasSyncSetupCompleted()) {
reason = syncer::CONFIGURE_REASON_NEW_CLIENT;
- } else if (restart == false ||
- syncer::InitialSyncEndedForTypes(types, GetUserShare())) {
- reason = syncer::CONFIGURE_REASON_RECONFIGURATION;
- } else {
- DCHECK(restart);
+ } else if (restart) {
+ // Datatype downloads on restart are generally due to newly supported
+ // datatypes (although it's also possible we're picking up where a failed
+ // previous configuration left off).
+ // TODO(sync): consider detecting configuration recovery and setting
+ // the reason here appropriately.
reason = syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE;
+ } else {
+ // The user initiated a reconfiguration (either to add or remove types).
+ reason = syncer::CONFIGURE_REASON_RECONFIGURATION;
}
- DCHECK(reason != syncer::CONFIGURE_REASON_UNKNOWN);
data_type_manager_->Configure(types, reason);
}

Powered by Google App Engine
This is Rietveld 408576698