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

Unified Diff: components/browser_sync/profile_sync_service.cc

Issue 2649133012: [Sync] Calculate active types and track catch up in DTMI not PSS. (Closed)
Patch Set: Fix ProfileSyncServiceTest. Created 3 years, 11 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: components/browser_sync/profile_sync_service.cc
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index d95fccdcf275cf30c22f545529571cfd7cd14f2b..3cb5c33fb6fea18bd4aa09ea1bc163180f2ecc31 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -213,7 +213,6 @@ ProfileSyncService::ProfileSyncService(InitParams init_params)
gaia_cookie_manager_service_(init_params.gaia_cookie_manager_service),
network_resources_(new syncer::HttpBridgeNetworkResources),
start_behavior_(init_params.start_behavior),
- catch_up_configure_in_progress_(false),
passphrase_prompt_triggered_by_version_(false),
sync_enabled_weak_factory_(this),
weak_factory_(this) {
@@ -793,7 +792,6 @@ void ProfileSyncService::ShutdownImpl(syncer::ShutdownReason reason) {
encrypt_everything_ = false;
encrypted_types_ = syncer::SyncEncryptionHandler::SensitiveTypes();
passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED;
- catch_up_configure_in_progress_ = false;
access_token_.clear();
request_access_token_retry_timer_.Stop();
last_snapshot_ = syncer::SyncCycleSnapshot();
@@ -1320,7 +1318,6 @@ void ProfileSyncService::BeginConfigureCatchUpBeforeClear() {
sync_prefs_.GetNigoriSpecificsForPassphraseTransition(
&saved_nigori_state_->nigori_specifics);
const syncer::ModelTypeSet types = GetActiveDataTypes();
- catch_up_configure_in_progress_ = true;
data_type_manager_->Configure(types, syncer::CONFIGURE_REASON_CATCH_UP);
}
@@ -1392,7 +1389,7 @@ void ProfileSyncService::OnConfigureDone(
// Handle unrecoverable error.
if (configure_status_ != DataTypeManager::OK) {
- if (catch_up_configure_in_progress_) {
+ if (result.was_catch_up_configure) {
// Record catchup configuration failure.
UMA_HISTOGRAM_ENUMERATION(kClearServerDataEventsHistogramName,
CLEAR_SERVER_DATA_CATCHUP_FAILED,
@@ -1436,8 +1433,7 @@ void ProfileSyncService::OnConfigureDone(
return;
}
- if (catch_up_configure_in_progress_) {
- catch_up_configure_in_progress_ = false;
+ if (result.was_catch_up_configure) {
ClearAndRestartSyncForPassphraseEncryption();
return;
}
@@ -1739,12 +1735,9 @@ void ProfileSyncService::ChangePreferredDataTypes(
syncer::ModelTypeSet ProfileSyncService::GetActiveDataTypes() const {
DCHECK(thread_checker_.CalledOnValidThread());
- if (!IsSyncActive() || !ConfigurationDone())
+ if (!data_type_manager_)
return syncer::ModelTypeSet();
- const syncer::ModelTypeSet preferred_types = GetPreferredDataTypes();
- const syncer::ModelTypeSet failed_types =
- data_type_status_table_.GetFailedTypes();
- return Difference(preferred_types, failed_types);
+ return data_type_manager_->GetActiveDataTypes();
}
syncer::SyncClient* ProfileSyncService::GetSyncClient() const {

Powered by Google App Engine
This is Rietveld 408576698