Chromium Code Reviews| 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()); |
|
Alexei Svitkine (slow)
2015/02/18 21:48:03
Ditto.
rkaplow
2015/02/19 00:18:57
Also ditto - any suggestions?
|
| // 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 |