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

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

Issue 1024553010: [Sync] Add support for immediately enabling wallet datatype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 5 years, 9 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 7ea11bc436346c347ce2cec75874136c9a0a2ee3..10df114478df337063da55950a72a17bfcc4c634 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -958,12 +958,6 @@ void ProfileSyncService::ClearUnrecoverableError() {
unrecoverable_error_location_ = tracked_objects::Location();
}
-void ProfileSyncService::RegisterNewDataType(syncer::ModelType data_type) {
- if (directory_data_type_controllers_.count(data_type) > 0)
- return;
- NOTREACHED();
-}
-
// An invariant has been violated. Transition to an error state where we try
// to do as little work as possible, to avoid further corruption or crashes.
void ProfileSyncService::OnUnrecoverableError(
@@ -1001,7 +995,8 @@ void ProfileSyncService::OnUnrecoverableErrorImpl(
}
void ProfileSyncService::ReenableDatatype(syncer::ModelType type) {
- DCHECK(backend_initialized_);
+ if (!backend_initialized_)
+ return;
directory_data_type_manager_->ReenableType(type);
}
@@ -1159,54 +1154,9 @@ void ProfileSyncService::OnExperimentsChanged(
profile()->GetPrefs()->SetBoolean(prefs::kInvalidationServiceUseGCMChannel,
experiments.gcm_invalidations_enabled);
- profile()->GetPrefs()->SetBoolean(
- autofill::prefs::kAutofillWalletSyncExperimentEnabled,
- experiments.wallet_sync_enabled);
-
- // If this is a first time sync for a client, this will be called before
- // OnBackendInitialized() to ensure the new datatypes are available at sync
- // setup. As a result, the migrator won't exist yet. This is fine because for
- // first time sync cases we're only concerned with making the datatype
- // available.
- if (migrator_.get() &&
- migrator_->state() != browser_sync::BackendMigrator::IDLE) {
- DVLOG(1) << "Dropping OnExperimentsChanged due to migrator busy.";
- return;
- }
-
- const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes();
- syncer::ModelTypeSet to_add;
- const syncer::ModelTypeSet to_register =
- Difference(to_add, registered_types);
- DVLOG(2) << "OnExperimentsChanged called with types: "
- << syncer::ModelTypeSetToString(to_add);
- DVLOG(2) << "Enabling types: " << syncer::ModelTypeSetToString(to_register);
maniscalco 2015/03/25 00:31:47 Was autofill wallet the only type for which we wan
Nicolas Zea 2015/03/25 00:41:17 Yes. This code was effectively dead code previousl
-
- for (syncer::ModelTypeSet::Iterator it = to_register.First();
- it.Good(); it.Inc()) {
- // Received notice to enable experimental type. Check if the type is
- // registered, and if not register a new datatype controller.
- RegisterNewDataType(it.Get());
- }
-
- // Check if the user has "Keep Everything Synced" enabled. If so, we want
- // to turn on all experimental types if they're not already on. Otherwise we
- // leave them off.
- // Note: if any types are already registered, we don't turn them on. This
- // covers the case where we're already in the process of reconfiguring
- // to turn an experimental type on.
- if (sync_prefs_.HasKeepEverythingSynced()) {
- // Mark all data types as preferred.
- sync_prefs_.SetPreferredDataTypes(registered_types, registered_types);
-
- // Only automatically turn on types if we have already finished set up.
- // Otherwise, just leave the experimental types on by default.
- if (!to_register.Empty() && HasSyncSetupCompleted() && migrator_) {
- DVLOG(1) << "Dynamically enabling new datatypes: "
- << syncer::ModelTypeSetToString(to_register);
- OnMigrationNeededForTypes(to_register);
- }
- }
+ // profile()->GetPrefs()->SetBoolean(
maniscalco 2015/03/25 00:31:48 Is this intentionally commented out or should it b
Nicolas Zea 2015/03/25 00:41:17 Blarg, this was from manual testing before uploadi
+ // autofill::prefs::kAutofillWalletSyncExperimentEnabled,
+ // experiments.wallet_sync_enabled);
}
void ProfileSyncService::UpdateAuthErrorState(const AuthError& error) {

Powered by Google App Engine
This is Rietveld 408576698