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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser_sync/browser/profile_sync_service.h" 5 #include "components/browser_sync/browser/profile_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 sync_thread_ = doomed_backend->Shutdown(reason); 800 sync_thread_ = doomed_backend->Shutdown(reason);
801 doomed_backend.reset(); 801 doomed_backend.reset();
802 } 802 }
803 base::TimeDelta shutdown_time = base::Time::Now() - shutdown_start_time; 803 base::TimeDelta shutdown_time = base::Time::Now() - shutdown_start_time;
804 UMA_HISTOGRAM_TIMES("Sync.Shutdown.BackendDestroyedTime", shutdown_time); 804 UMA_HISTOGRAM_TIMES("Sync.Shutdown.BackendDestroyedTime", shutdown_time);
805 805
806 weak_factory_.InvalidateWeakPtrs(); 806 weak_factory_.InvalidateWeakPtrs();
807 807
808 startup_controller_->Reset(GetRegisteredDataTypes()); 808 startup_controller_->Reset(GetRegisteredDataTypes());
809 809
810 // If the sync DB is getting destroyed, the local DeviceInfo is no longer
811 // valid and should be cleared from the cache.
812 if (reason == syncer::ShutdownReason::DISABLE_SYNC) {
813 local_device_->Clear();
814 }
815
810 // Clear various flags. 816 // Clear various flags.
811 expect_sync_configuration_aborted_ = false; 817 expect_sync_configuration_aborted_ = false;
812 is_auth_in_progress_ = false; 818 is_auth_in_progress_ = false;
813 backend_initialized_ = false; 819 backend_initialized_ = false;
814 cached_passphrase_.clear(); 820 cached_passphrase_.clear();
815 encryption_pending_ = false; 821 encryption_pending_ = false;
816 encrypt_everything_ = false; 822 encrypt_everything_ = false;
817 encrypted_types_ = syncer::SyncEncryptionHandler::SensitiveTypes(); 823 encrypted_types_ = syncer::SyncEncryptionHandler::SensitiveTypes();
818 passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED; 824 passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED;
819 catch_up_configure_in_progress_ = false; 825 catch_up_configure_in_progress_ = false;
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 } 2533 }
2528 2534
2529 std::string ProfileSyncService::unrecoverable_error_message() const { 2535 std::string ProfileSyncService::unrecoverable_error_message() const {
2530 return unrecoverable_error_message_; 2536 return unrecoverable_error_message_;
2531 } 2537 }
2532 2538
2533 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2539 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2534 const { 2540 const {
2535 return unrecoverable_error_location_; 2541 return unrecoverable_error_location_;
2536 } 2542 }
OLDNEW
« 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