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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_core.cc

Issue 1253743003: [Sync] Update SyncBackendHost to forward ClearServerData to SyncManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clearserverdatacommand
Patch Set: Remove unused callback variable Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/glue/sync_backend_host_core.h" 5 #include "chrome/browser/sync/glue/sync_backend_host_core.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 save_changes_timer_->Start(FROM_HERE, 736 save_changes_timer_->Start(FROM_HERE,
737 base::TimeDelta::FromSeconds(kSaveChangesIntervalSeconds), 737 base::TimeDelta::FromSeconds(kSaveChangesIntervalSeconds),
738 this, &SyncBackendHostCore::SaveChanges); 738 this, &SyncBackendHostCore::SaveChanges);
739 } 739 }
740 740
741 void SyncBackendHostCore::SaveChanges() { 741 void SyncBackendHostCore::SaveChanges() {
742 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); 742 DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
743 sync_manager_->SaveChanges(); 743 sync_manager_->SaveChanges();
744 } 744 }
745 745
746 void SyncBackendHostCore::DoClearServerData(
747 const syncer::SyncManager::ClearServerDataCallback& frontend_callback) {
748 DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
749 const syncer::SyncManager::ClearServerDataCallback callback =
750 base::Bind(&SyncBackendHostCore::ClearServerDataDone,
751 weak_ptr_factory_.GetWeakPtr(), frontend_callback);
752 sync_manager_->ClearServerData(callback);
753 }
754
755 void SyncBackendHostCore::ClearServerDataDone(
756 const base::Closure& frontend_callback) {
757 DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
758 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop,
759 frontend_callback);
760 }
761
762
746 } // namespace browser_sync 763 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_core.h ('k') | chrome/browser/sync/glue/sync_backend_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698