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

Unified Diff: chrome/browser/sync/glue/sync_backend_host_impl.cc

Issue 437683002: Wire sync shutdown reason from PSS all the way down to sync manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/sync_backend_host_impl.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc
index 3532bf267afe33ffe57caf774247c4c05e48e997..6f4c7e37ddf33d03afb5f97c658ece1ab55ab2c4 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc
@@ -275,18 +275,17 @@ void SyncBackendHostImpl::StopSyncingForShutdown() {
core_->ShutdownOnUIThread();
}
-scoped_ptr<base::Thread> SyncBackendHostImpl::Shutdown(ShutdownOption option) {
+scoped_ptr<base::Thread> SyncBackendHostImpl::Shutdown(
+ syncer::ShutdownReason reason) {
// StopSyncingForShutdown() (which nulls out |frontend_|) should be
// called first.
DCHECK(!frontend_);
DCHECK(registrar_->sync_thread()->IsRunning());
- bool sync_disabled = (option == DISABLE_AND_CLAIM_THREAD);
- bool sync_thread_claimed =
- (option == DISABLE_AND_CLAIM_THREAD || option == STOP_AND_CLAIM_THREAD);
+ bool sync_thread_claimed = (reason != syncer::BROWSER_SHUTDOWN);
if (invalidation_handler_registered_) {
- if (sync_disabled) {
+ if (reason == syncer::DISABLE_SYNC) {
UnregisterInvalidationIds();
}
invalidator_->UnregisterInvalidationHandler(this);
@@ -298,7 +297,7 @@ scoped_ptr<base::Thread> SyncBackendHostImpl::Shutdown(ShutdownOption option) {
registrar_->sync_thread()->message_loop()->PostTask(
FROM_HERE,
base::Bind(&SyncBackendHostCore::DoShutdown,
- core_.get(), sync_disabled));
+ core_.get(), reason));
core_ = NULL;
// Worker cleanup.
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_impl.h ('k') | chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698