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

Unified Diff: components/browser_sync/browser/profile_sync_service.cc

Issue 1951703002: [Sync] Clear LocalDeviceInfoProvider cache on sync DB destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move NonThreadSafe to LocalDeviceInfoProviderImpl. Created 4 years, 7 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
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/browser/profile_sync_service.cc
diff --git a/components/browser_sync/browser/profile_sync_service.cc b/components/browser_sync/browser/profile_sync_service.cc
index 16c0aa28bba02e30aceb6dc7f3c3d7eaad8bdabe..4168d6b4db0414118c0d5822376711523ae07281 100644
--- a/components/browser_sync/browser/profile_sync_service.cc
+++ b/components/browser_sync/browser/profile_sync_service.cc
@@ -807,6 +807,12 @@ void ProfileSyncService::ShutdownImpl(syncer::ShutdownReason reason) {
startup_controller_->Reset(GetRegisteredDataTypes());
+ // If the sync DB is getting destroyed, the local DeviceInfo is no longer
+ // valid and should be cleared from the cache.
+ if (reason == syncer::ShutdownReason::DISABLE_SYNC) {
+ local_device_->Clear();
+ }
+
// Clear various flags.
expect_sync_configuration_aborted_ = false;
is_auth_in_progress_ = false;
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698