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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 944433002: Revamp the MigrateBrowserPrefs and MigrateUserPrefs code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gab comments Created 5 years, 10 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 (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 "chrome/browser/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 } 848 }
849 849
850 void ProfileImpl::OnPrefsLoaded(bool success) { 850 void ProfileImpl::OnPrefsLoaded(bool success) {
851 TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded") 851 TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded")
852 if (!success) { 852 if (!success) {
853 if (delegate_) 853 if (delegate_)
854 delegate_->OnProfileCreated(this, false, false); 854 delegate_->OnProfileCreated(this, false, false);
855 return; 855 return;
856 } 856 }
857 857
858 // TODO(mirandac): remove migration code after 6 months (crbug.com/69995). 858 // Migrate all obsolete prefs.
gab 2015/02/20 20:33:57 rm "all" (it's implicit IMO) PS: I like "obsolete
rkaplow 2015/02/20 21:58:08 Seems fine. Note that some of the work is done by
859 if (g_browser_process->local_state()) 859 if (g_browser_process->local_state())
860 chrome::MigrateBrowserPrefs(this, g_browser_process->local_state()); 860 chrome::MigrateBrowserPrefs(this, g_browser_process->local_state());
861 // TODO(ivankr): remove cleanup code eventually (crbug.com/165672).
862 chrome::MigrateUserPrefs(this); 861 chrome::MigrateUserPrefs(this);
863 862
864 // |kSessionExitType| was added after |kSessionExitedCleanly|. If the pref 863 // |kSessionExitType| was added after |kSessionExitedCleanly|. If the pref
865 // value is empty fallback to checking for |kSessionExitedCleanly|. 864 // value is empty fallback to checking for |kSessionExitedCleanly|.
866 const std::string exit_type_pref_value( 865 const std::string exit_type_pref_value(
867 prefs_->GetString(prefs::kSessionExitType)); 866 prefs_->GetString(prefs::kSessionExitType));
868 if (exit_type_pref_value.empty()) { 867 if (exit_type_pref_value.empty()) {
869 last_session_exit_type_ = 868 last_session_exit_type_ =
870 prefs_->GetBoolean(prefs::kSessionExitedCleanly) ? 869 prefs_->GetBoolean(prefs::kSessionExitedCleanly) ?
871 EXIT_NORMAL : EXIT_CRASHED; 870 EXIT_NORMAL : EXIT_CRASHED;
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1322 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1324 domain_reliability::DomainReliabilityService* service = 1323 domain_reliability::DomainReliabilityService* service =
1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1324 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1326 GetForBrowserContext(this); 1325 GetForBrowserContext(this);
1327 if (!service) 1326 if (!service)
1328 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1327 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1329 1328
1330 return service->CreateMonitor( 1329 return service->CreateMonitor(
1331 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1330 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1332 } 1331 }
OLDNEW
« chrome/browser/prefs/browser_prefs.cc ('K') | « chrome/browser/prefs/browser_prefs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698