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

Unified Diff: chrome/browser/task_manager/task_manager_resource_providers.cc

Issue 8539043: Refactor ProfileInfoCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
Index: chrome/browser/task_manager/task_manager_resource_providers.cc
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc
index ee35c315c5bbc78bdd79f344cef4cb0e44b1e7b4..6e2cff6b27c287a90300d7a053256064fe1347e8 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -285,11 +285,10 @@ string16 TaskManagerTabContentsResource::GetProfileName() const {
ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
Profile* profile = tab_contents_->profile()->GetOriginalProfile();
- size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- if (index == std::string::npos)
- return string16();
- else
- return cache.GetNameOfProfileAtIndex(index);
+ ProfileInfoEntry entry;
+ if (cache.GetInfoForProfile(profile->GetPath(), &entry))
+ return entry.name();
+ return string16();
}
SkBitmap TaskManagerTabContentsResource::GetIcon() const {
@@ -1080,11 +1079,10 @@ string16 TaskManagerExtensionProcessResource::GetProfileName() const {
ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
Profile* profile = extension_host_->profile()->GetOriginalProfile();
- size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- if (index == std::string::npos)
- return string16();
- else
- return cache.GetNameOfProfileAtIndex(index);
+ ProfileInfoEntry entry;
+ if (cache.GetInfoForProfile(profile->GetPath(), &entry))
+ return entry.name();
+ return string16();
}
SkBitmap TaskManagerExtensionProcessResource::GetIcon() const {
« no previous file with comments | « chrome/browser/profiles/profile_manager.cc ('k') | chrome/browser/ui/cocoa/browser/avatar_button_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698