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

Unified Diff: components/browser_sync/profile_sync_service.cc

Issue 2716413003: Initial clear server data impl (Closed)
Patch Set: CL changes Created 3 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/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 2909868bc33e3addeee8a618ad28c941de3a26e5..188a4a0c89ccba2f357a8763be939850f6a2b27c 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -1386,6 +1386,7 @@ bool ProfileSyncService::IsFirstSetupInProgress() const {
std::unique_ptr<syncer::SyncSetupInProgressHandle>
ProfileSyncService::GetSetupInProgressHandle() {
DCHECK(thread_checker_.CalledOnValidThread());
+
if (++outstanding_setup_in_progress_handles_ == 1) {
DCHECK(!startup_controller_->IsSetupInProgress());
startup_controller_->SetSetupInProgress(true);
@@ -2426,4 +2427,12 @@ void ProfileSyncService::OnSetupInProgressHandleDestroyed() {
NotifyObservers();
}
+void ProfileSyncService::ClearServerDataForTest(const base::Closure& callback) {
pavely 2017/03/08 21:15:14 Why is this function placed at the end of file?
wylieb 2017/03/09 18:42:26 Good point. I moved it under ClearAndRestart...
+ DCHECK(thread_checker_.CalledOnValidThread());
+ // Sync has a restriction that the engine must be in configuration mode
+ // in order to run clear server data.
+ engine_->StartConfiguration();
+ engine_->ClearServerData(callback);
+}
+
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698