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

Unified Diff: components/browser_sync/profile_sync_service.cc

Issue 2716413003: Initial clear server data impl (Closed)
Patch Set: Addressing newlines, and unused arguments 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
« no previous file with comments | « components/browser_sync/profile_sync_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ace66848b2bc61c503aad048fedfa420c87ac217 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -1199,6 +1199,14 @@ void ProfileSyncService::OnClearServerDataDone() {
syncer::CLEAR_SERVER_DATA_MAX);
}
+void ProfileSyncService::ClearServerDataForTest(const base::Closure& callback) {
+ 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);
+}
+
void ProfileSyncService::OnConfigureDone(
const DataTypeManager::ConfigureResult& result) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -1386,6 +1394,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);
@@ -2425,5 +2434,4 @@ void ProfileSyncService::OnSetupInProgressHandleDestroyed() {
ReconfigureDatatypeManager();
NotifyObservers();
}
-
} // namespace browser_sync
« no previous file with comments | « components/browser_sync/profile_sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698