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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 1106213003: Optimize writes upon ProfileManager::UpdateLastUser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « chrome/browser/profiles/profile_info_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index b20c703842526f0394a0d84a81b1143887327592..24d66eae26287e9241b8db86487d36905c75ae85 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -1332,8 +1332,10 @@ void ProfileManager::UpdateLastUser(Profile* last_active) {
DCHECK(local_state);
// Only keep track of profiles that we are managing; tests may create others.
if (profiles_info_.find(last_active->GetPath()) != profiles_info_.end()) {
- local_state->SetString(prefs::kProfileLastUsed,
- last_active->GetPath().BaseName().MaybeAsASCII());
+ std::string profile_path_base =
+ last_active->GetPath().BaseName().MaybeAsASCII();
+ if (profile_path_base != local_state->GetString(prefs::kProfileLastUsed))
+ local_state->SetString(prefs::kProfileLastUsed, profile_path_base);
ProfileInfoCache& cache = GetProfileInfoCache();
size_t profile_index =
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698