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

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: readd method 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
« no previous file with comments | « chrome/browser/prefs/browser_prefs.h ('k') | no next file » | 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 "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).
859 if (g_browser_process->local_state())
860 chrome::MigrateBrowserPrefs(this, g_browser_process->local_state());
861 // TODO(ivankr): remove cleanup code eventually (crbug.com/165672). 858 // TODO(ivankr): remove cleanup code eventually (crbug.com/165672).
gab 2015/02/20 19:04:03 No, we shouldn't get rid of this hook. If anythin
rkaplow 2015/02/20 19:08:53 Hm, ok. How long should pref migration live for?
862 chrome::MigrateUserPrefs(this); 859 chrome::MigrateUserPrefs(this);
863 860
864 // |kSessionExitType| was added after |kSessionExitedCleanly|. If the pref 861 // |kSessionExitType| was added after |kSessionExitedCleanly|. If the pref
865 // value is empty fallback to checking for |kSessionExitedCleanly|. 862 // value is empty fallback to checking for |kSessionExitedCleanly|.
866 const std::string exit_type_pref_value( 863 const std::string exit_type_pref_value(
867 prefs_->GetString(prefs::kSessionExitType)); 864 prefs_->GetString(prefs::kSessionExitType));
868 if (exit_type_pref_value.empty()) { 865 if (exit_type_pref_value.empty()) {
869 last_session_exit_type_ = 866 last_session_exit_type_ =
870 prefs_->GetBoolean(prefs::kSessionExitedCleanly) ? 867 prefs_->GetBoolean(prefs::kSessionExitedCleanly) ?
871 EXIT_NORMAL : EXIT_CRASHED; 868 EXIT_NORMAL : EXIT_CRASHED;
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1320 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1324 domain_reliability::DomainReliabilityService* service = 1321 domain_reliability::DomainReliabilityService* service =
1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1322 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1326 GetForBrowserContext(this); 1323 GetForBrowserContext(this);
1327 if (!service) 1324 if (!service)
1328 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1325 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1329 1326
1330 return service->CreateMonitor( 1327 return service->CreateMonitor(
1331 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1328 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1332 } 1329 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698