diff options
author | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 11:37:21 +0000 |
---|---|---|
committer | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 11:37:21 +0000 |
commit | 844a10004ee756dd8c4fa9c0c5e6ccadabd83b74 (patch) | |
tree | c25f0168789bca79d68982a3a0b9cd0d39286c81 /chrome/browser/app_controller_mac.mm | |
parent | 9b464b9ca9cebbad516d537a742c2ea9c351a860 (diff) | |
download | chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.zip chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.tar.gz chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.tar.bz2 |
This CL implements alternative asynchronous methods for profile and preferences loading.
BUG=chromium-os:11104
TEST=UserProfileGotten (see "/tmp/login-times-sent") time doesn't increase, while UI jankness decreases.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=81394 (patch set <= 25), but reverted.
Review URL: http://codereview.chromium.org/6716025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 6934219..3be6c92 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -599,18 +599,17 @@ void RecordLastRunAppBundlePath() { if (!profile_manager) return YES; - ProfileManager::const_iterator it = profile_manager->begin(); - for (; it != profile_manager->end(); ++it) { - Profile* profile = *it; - DownloadManager* download_manager = profile->GetDownloadManager(); + std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); + for (size_t i = 0; i < profiles.size(); ++i) { + DownloadManager* download_manager = profiles[i]->GetDownloadManager(); if (download_manager && download_manager->in_progress_count() > 0) { int downloadCount = download_manager->in_progress_count(); if ([self userWillWaitForInProgressDownloads:downloadCount]) { // Create a new browser window (if necessary) and navigate to the // downloads page if the user chooses to wait. - Browser* browser = BrowserList::FindBrowserWithProfile(profile); + Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]); if (!browser) { - browser = Browser::Create(profile); + browser = Browser::Create(profiles[i]); browser->window()->Show(); } DCHECK(browser); @@ -984,9 +983,8 @@ void RecordLastRunAppBundlePath() { } - (Profile*)defaultProfile { - // TODO(jrg): Find a better way to get the "default" profile. if (g_browser_process->profile_manager()) - return *g_browser_process->profile_manager()->begin(); + return g_browser_process->profile_manager()->GetDefaultProfile(); return NULL; } |