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

Unified Diff: components/sync_driver/data_type_manager_impl.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: components/sync_driver/data_type_manager_impl.cc
diff --git a/components/sync_driver/data_type_manager_impl.cc b/components/sync_driver/data_type_manager_impl.cc
index dfffa3c775078403ff6a0a8aa4071e9a9dbfd68a..bc6ec16f3b56f1184d1d8582bd1b8015a65ca139 100644
--- a/components/sync_driver/data_type_manager_impl.cc
+++ b/components/sync_driver/data_type_manager_impl.cc
@@ -260,12 +260,14 @@ void DataTypeManagerImpl::Restart(syncer::ConfigureReason reason) {
DCHECK(state_ == STOPPED || state_ == CONFIGURED || state_ == RETRYING);
+ State old_state = state_;
maniscalco 2015/03/25 00:31:48 Opportunity for const, const State old_state = st
Nicolas Zea 2015/03/25 00:41:17 Done.
+ state_ = DOWNLOAD_PENDING;
maniscalco 2015/03/25 00:31:48 So is it important that we set state_ to DOWNLOAD_
Nicolas Zea 2015/03/25 00:41:17 Yes, as NotifyStart() can trigger ProfileSyncServi
maniscalco 2015/03/25 00:47:53 Got it. That's a helpful comment. Thanks for add
+
// Starting from a "steady state" (stopped or configured) state
// should send a start notification.
- if (state_ == STOPPED || state_ == CONFIGURED)
+ if (old_state == STOPPED || old_state == CONFIGURED)
NotifyStart();
- state_ = DOWNLOAD_PENDING;
download_types_queue_ = PrioritizeTypes(enabled_types);
association_types_queue_ = std::queue<AssociationTypesInfo>();

Powered by Google App Engine
This is Rietveld 408576698