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

Side by Side Diff: components/sync/driver/glue/sync_backend_host_core.cc

Issue 2770933007: [Sync] Replace ClearServerDataCallback with Closure. (Closed)
Patch Set: 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 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 "components/sync/driver/glue/sync_backend_host_core.h" 5 #include "components/sync/driver/glue/sync_backend_host_core.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 FROM_HERE, base::TimeDelta::FromSeconds(kSaveChangesIntervalSeconds), 569 FROM_HERE, base::TimeDelta::FromSeconds(kSaveChangesIntervalSeconds),
570 this, &SyncBackendHostCore::SaveChanges); 570 this, &SyncBackendHostCore::SaveChanges);
571 } 571 }
572 572
573 void SyncBackendHostCore::SaveChanges() { 573 void SyncBackendHostCore::SaveChanges() {
574 DCHECK(thread_checker_.CalledOnValidThread()); 574 DCHECK(thread_checker_.CalledOnValidThread());
575 sync_manager_->SaveChanges(); 575 sync_manager_->SaveChanges();
576 } 576 }
577 577
578 void SyncBackendHostCore::DoClearServerData( 578 void SyncBackendHostCore::DoClearServerData(
579 const SyncManager::ClearServerDataCallback& frontend_callback) { 579 const base::Closure& frontend_callback) {
580 DCHECK(thread_checker_.CalledOnValidThread()); 580 DCHECK(thread_checker_.CalledOnValidThread());
581 const SyncManager::ClearServerDataCallback callback = 581 const base::Closure callback =
582 base::Bind(&SyncBackendHostCore::ClearServerDataDone, 582 base::Bind(&SyncBackendHostCore::ClearServerDataDone,
583 weak_ptr_factory_.GetWeakPtr(), frontend_callback); 583 weak_ptr_factory_.GetWeakPtr(), frontend_callback);
584 sync_manager_->ClearServerData(callback); 584 sync_manager_->ClearServerData(callback);
585 } 585 }
586 586
587 void SyncBackendHostCore::DoOnCookieJarChanged(bool account_mismatch, 587 void SyncBackendHostCore::DoOnCookieJarChanged(bool account_mismatch,
588 bool empty_jar, 588 bool empty_jar,
589 const base::Closure& callback) { 589 const base::Closure& callback) {
590 DCHECK(thread_checker_.CalledOnValidThread()); 590 DCHECK(thread_checker_.CalledOnValidThread());
591 sync_manager_->OnCookieJarChanged(account_mismatch, empty_jar); 591 sync_manager_->OnCookieJarChanged(account_mismatch, empty_jar);
592 if (!callback.is_null()) { 592 if (!callback.is_null()) {
593 host_.Call(FROM_HERE, 593 host_.Call(FROM_HERE,
594 &SyncBackendHostImpl::OnCookieJarChangedDoneOnFrontendLoop, 594 &SyncBackendHostImpl::OnCookieJarChangedDoneOnFrontendLoop,
595 callback); 595 callback);
596 } 596 }
597 } 597 }
598 598
599 void SyncBackendHostCore::ClearServerDataDone( 599 void SyncBackendHostCore::ClearServerDataDone(
600 const base::Closure& frontend_callback) { 600 const base::Closure& frontend_callback) {
601 DCHECK(thread_checker_.CalledOnValidThread()); 601 DCHECK(thread_checker_.CalledOnValidThread());
602 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop, 602 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop,
603 frontend_callback); 603 frontend_callback);
604 } 604 }
605 605
606 } // namespace syncer 606 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/glue/sync_backend_host_core.h ('k') | components/sync/driver/glue/sync_backend_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698