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

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

Issue 937713003: Add several new TRACE call and UMA metrics for GetProfile() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: noms asvitkine 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 781158517596b62bc8ad0247e744f9e1f8c67142..0ed08a59c492b89bd68c8e3ff5f8bb1b1a9f08c5 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -374,21 +374,13 @@ Profile* ProfileManager::GetActiveUserProfile() {
Profile* ProfileManager::GetProfile(const base::FilePath& profile_dir) {
TRACE_EVENT0("browser", "ProfileManager::GetProfile");
- SCOPED_UMA_HISTOGRAM_TIMER("Profile.GetProfile");
// If the profile is already loaded (e.g., chrome.exe launched twice), just
// return it.
Profile* profile = GetProfileByPath(profile_dir);
if (NULL != profile)
return profile;
-
- profile = CreateProfileHelper(profile_dir);
- DCHECK(profile);
- if (profile) {
- bool result = AddProfile(profile);
- DCHECK(result);
- }
- return profile;
+ return CreateAndInitializeProfile(profile_dir);
}
size_t ProfileManager::GetNumberOfProfiles() {
@@ -402,10 +394,10 @@ void ProfileManager::CreateProfileAsync(
const base::string16& icon_url,
const std::string& supervised_user_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- TRACE_EVENT1("startup",
+ TRACE_EVENT1("browser,startup",
"ProfileManager::CreateProfileAsync",
"profile_path",
- profile_path.value().c_str());
+ profile_path.MaybeAsASCII());
// Make sure that this profile is not pending deletion.
if (IsProfileMarkedForDeletion(profile_path)) {
@@ -1076,6 +1068,8 @@ void ProfileManager::DoFinalInitLogging(Profile* profile) {
Profile* ProfileManager::CreateProfileHelper(const base::FilePath& path) {
TRACE_EVENT0("browser", "ProfileManager::CreateProfileHelper");
+ SCOPED_UMA_HISTOGRAM_TIMER("Profile.CreateProfileHelperTime");
+
return Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS);
}
@@ -1142,6 +1136,19 @@ bool ProfileManager::AddProfile(Profile* profile) {
return true;
}
+Profile* ProfileManager::CreateAndInitializeProfile(
+ const base::FilePath& profile_dir) {
+ TRACE_EVENT0("browser", "ProfileManager::CreateAndInitializeProfile");
+ SCOPED_UMA_HISTOGRAM_LONG_TIMER("Profile.CreateAndInitializeProfile");
+ Profile* profile = CreateProfileHelper(profile_dir);
+ DCHECK(profile);
+ if (profile) {
+ bool result = AddProfile(profile);
+ DCHECK(result);
+ }
+ return profile;
+}
+
void ProfileManager::FinishDeletingProfile(const base::FilePath& profile_dir) {
ProfileInfoCache& cache = GetProfileInfoCache();
// TODO(sail): Due to bug 88586 we don't delete the profile instance. Once we

Powered by Google App Engine
This is Rietveld 408576698