OLD | NEW |
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 Loading... |
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 |
OLD | NEW |