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

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

Issue 2751333007: [Sync] Try to fix race conditions in CookieJarMismatch. (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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 void SyncBackendHostCore::DoClearServerData( 578 void SyncBackendHostCore::DoClearServerData(
579 const SyncManager::ClearServerDataCallback& frontend_callback) { 579 const SyncManager::ClearServerDataCallback& frontend_callback) {
580 DCHECK(thread_checker_.CalledOnValidThread()); 580 DCHECK(thread_checker_.CalledOnValidThread());
581 const SyncManager::ClearServerDataCallback callback = 581 const SyncManager::ClearServerDataCallback 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 DCHECK(thread_checker_.CalledOnValidThread()); 590 DCHECK(thread_checker_.CalledOnValidThread());
590 sync_manager_->OnCookieJarChanged(account_mismatch, empty_jar); 591 sync_manager_->OnCookieJarChanged(account_mismatch, empty_jar);
592 if (!callback.is_null()) {
593 host_.Call(FROM_HERE,
594 &SyncBackendHostImpl::OnCookieJarChangedDoneOnFrontendLoop,
595 callback);
596 }
591 } 597 }
592 598
593 void SyncBackendHostCore::ClearServerDataDone( 599 void SyncBackendHostCore::ClearServerDataDone(
594 const base::Closure& frontend_callback) { 600 const base::Closure& frontend_callback) {
595 DCHECK(thread_checker_.CalledOnValidThread()); 601 DCHECK(thread_checker_.CalledOnValidThread());
596 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop, 602 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop,
597 frontend_callback); 603 frontend_callback);
598 } 604 }
599 605
600 } // namespace syncer 606 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698