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

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: fix typo 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..ba15476a3edcae6fd85a966dea9a0c2b8fd885b7 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -374,15 +374,19 @@ 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;
+ return SetupProfile(profile_dir);
+}
- profile = CreateProfileHelper(profile_dir);
+Profile* ProfileManager::SetupProfile(const base::FilePath& profile_dir) {
+ TRACE_EVENT0("browser", "ProfileManager::SetupProfile");
+ SCOPED_UMA_HISTOGRAM_LONG_TIMER("Profile.SetupProfile");
+ Profile* profile = CreateProfileHelper(profile_dir);
DCHECK(profile);
if (profile) {
bool result = AddProfile(profile);
@@ -402,10 +406,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 +1080,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);
}

Powered by Google App Engine
This is Rietveld 408576698