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

Unified Diff: chrome/browser/profiles/profile_info_cache.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 | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache.cc
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index 583441d71cb1544d2c15491af406807a7ec1385c..902b148c6c3005df0267727c8cef51e31d2e08fd 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -471,6 +471,11 @@ size_t ProfileInfoCache::GetAvatarIconIndexOfProfileAtIndex(size_t index)
}
void ProfileInfoCache::SetProfileActiveTimeAtIndex(size_t index) {
+ if (base::Time::Now() - GetProfileActiveTimeAtIndex(index) <
+ base::TimeDelta::FromHours(1)) {
+ return;
+ }
+
scoped_ptr<base::DictionaryValue> info(
GetInfoForProfileAtIndex(index)->DeepCopy());
info->SetDouble(kActiveTimeKey, base::Time::Now().ToDoubleT());
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698