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

Side by Side Diff: components/sync/driver/glue/sync_backend_host_impl.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_impl.h" 5 #include "components/sync/driver/glue/sync_backend_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 sync_prefs_->UpdateInvalidationVersions(invalidation_versions); 415 sync_prefs_->UpdateInvalidationVersions(invalidation_versions);
416 } 416 }
417 417
418 void SyncBackendHostImpl::RefreshTypesForTest(ModelTypeSet types) { 418 void SyncBackendHostImpl::RefreshTypesForTest(ModelTypeSet types) {
419 DCHECK(thread_checker_.CalledOnValidThread()); 419 DCHECK(thread_checker_.CalledOnValidThread());
420 sync_task_runner_->PostTask( 420 sync_task_runner_->PostTask(
421 FROM_HERE, 421 FROM_HERE,
422 base::Bind(&SyncBackendHostCore::DoRefreshTypes, core_, types)); 422 base::Bind(&SyncBackendHostCore::DoRefreshTypes, core_, types));
423 } 423 }
424 424
425 void SyncBackendHostImpl::ClearServerData( 425 void SyncBackendHostImpl::ClearServerData(const base::Closure& callback) {
426 const SyncManager::ClearServerDataCallback& callback) {
427 DCHECK(thread_checker_.CalledOnValidThread()); 426 DCHECK(thread_checker_.CalledOnValidThread());
428 sync_task_runner_->PostTask( 427 sync_task_runner_->PostTask(
429 FROM_HERE, 428 FROM_HERE,
430 base::Bind(&SyncBackendHostCore::DoClearServerData, core_, callback)); 429 base::Bind(&SyncBackendHostCore::DoClearServerData, core_, callback));
431 } 430 }
432 431
433 void SyncBackendHostImpl::OnCookieJarChanged(bool account_mismatch, 432 void SyncBackendHostImpl::OnCookieJarChanged(bool account_mismatch,
434 bool empty_jar, 433 bool empty_jar,
435 const base::Closure& callback) { 434 const base::Closure& callback) {
436 DCHECK(thread_checker_.CalledOnValidThread()); 435 DCHECK(thread_checker_.CalledOnValidThread());
437 sync_task_runner_->PostTask( 436 sync_task_runner_->PostTask(
438 FROM_HERE, base::Bind(&SyncBackendHostCore::DoOnCookieJarChanged, core_, 437 FROM_HERE, base::Bind(&SyncBackendHostCore::DoOnCookieJarChanged, core_,
439 account_mismatch, empty_jar, callback)); 438 account_mismatch, empty_jar, callback));
440 } 439 }
441 440
442 void SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop( 441 void SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop(
443 const SyncManager::ClearServerDataCallback& frontend_callback) { 442 const base::Closure& frontend_callback) {
444 DCHECK(thread_checker_.CalledOnValidThread()); 443 DCHECK(thread_checker_.CalledOnValidThread());
445 frontend_callback.Run(); 444 frontend_callback.Run();
446 } 445 }
447 446
448 void SyncBackendHostImpl::OnCookieJarChangedDoneOnFrontendLoop( 447 void SyncBackendHostImpl::OnCookieJarChangedDoneOnFrontendLoop(
449 const base::Closure& callback) { 448 const base::Closure& callback) {
450 DCHECK(thread_checker_.CalledOnValidThread()); 449 DCHECK(thread_checker_.CalledOnValidThread());
451 callback.Run(); 450 callback.Run();
452 } 451 }
453 452
454 } // namespace syncer 453 } // namespace syncer
455 454
456 #undef SDVLOG 455 #undef SDVLOG
457 456
458 #undef SLOG 457 #undef SLOG
OLDNEW
« no previous file with comments | « components/sync/driver/glue/sync_backend_host_impl.h ('k') | components/sync/engine/fake_sync_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698