diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 23:42:39 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 23:42:39 +0000 |
commit | e8c82c8fc20170b52ca31b1315bd78009c481373 (patch) | |
tree | e6af93a25f02cbb9f24ccc5d66aacd5e834f156a | |
parent | a7ab1b782edde4b8558ccba857ea64cb1e8e8d1c (diff) | |
download | chromium_src-e8c82c8fc20170b52ca31b1315bd78009c481373.zip chromium_src-e8c82c8fc20170b52ca31b1315bd78009c481373.tar.gz chromium_src-e8c82c8fc20170b52ca31b1315bd78009c481373.tar.bz2 |
Move cookie fetching earlier, and don't block restore on it
This also fixes bug with logging in twice not clearing the
start time, and a merge problem with cookie fetching in
login_utils.cc
BUG=chromium-os:7971
TEST=check /tmp/login-times-sent. Should see login complete before cookies fetched
(CookiesFetched won't appear).
Review URL: http://codereview.chromium.org/4034005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63449 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/boot_times_loader.cc | 3 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/cookie_fetcher.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/login_utils.cc | 26 |
3 files changed, 13 insertions, 18 deletions
diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index e85b050..00151b8 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -240,7 +240,7 @@ void BootTimesLoader::WriteLoginTimes( std::string output = base::StringPrintf("%s: %.2f", kUmaLogin, total.InSecondsF()); base::Time prev = first; - for (unsigned int i = 1; i < login_times.size(); ++i) { + for (unsigned int i = 0; i < login_times.size(); ++i) { TimeMarker tm = login_times[i]; base::TimeDelta since_first = tm.time() - first; base::TimeDelta since_prev = tm.time() - prev; @@ -300,6 +300,7 @@ void BootTimesLoader::RecordChromeMainStats() { } void BootTimesLoader::RecordLoginAttempted() { + login_time_markers_.clear(); AddLoginTimeMarker("LoginStarted", false); if (!have_registered_) { have_registered_ = true; diff --git a/chrome/browser/chromeos/login/cookie_fetcher.cc b/chrome/browser/chromeos/login/cookie_fetcher.cc index 37fe098..d157de9 100644 --- a/chrome/browser/chromeos/login/cookie_fetcher.cc +++ b/chrome/browser/chromeos/login/cookie_fetcher.cc @@ -47,9 +47,7 @@ void CookieFetcher::OnURLFetchComplete(const URLFetcher* source, return; } } - VLOG(1) << "Calling DoLaunch"; BootTimesLoader::Get()->AddLoginTimeMarker("CookiesFetched", false); - launcher_->DoLaunch(profile_); delete this; } diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index b1c2029..421c135 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -143,6 +143,16 @@ void LoginUtilsImpl::CompleteLogin(const std::string& username, Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); btl->AddLoginTimeMarker("UserProfileGotten", false); + // Take the credentials passed in and try to exchange them for + // full-fledged Google authentication cookies. This is + // best-effort; it's possible that we'll fail due to network + // troubles or some such. Either way, |cf| will call + // DoBrowserLaunch on the UI thread when it's done, and then + // delete itself. + CookieFetcher* cf = new CookieFetcher(profile); + cf->AttemptFetch(credentials.data); + btl->AddLoginTimeMarker("CookieFetchStarted", false); + // Init extension event routers; this normally happens in browser_main // but on Chrome OS it has to be deferred until the user finishes // logging in and the profile is not OTR. @@ -152,11 +162,6 @@ void LoginUtilsImpl::CompleteLogin(const std::string& username, } btl->AddLoginTimeMarker("ExtensionsServiceStarted", false); - logging::RedirectChromeLogging( - user_data_dir.Append(profile_manager->GetCurrentProfileDir()), - *(CommandLine::ForCurrentProcess()), - logging::DELETE_OLD_LOG_FILE); - // Supply credentials for sync and others to use. Load tokens from disk. TokenService* token_service = profile->GetTokenService(); token_service->Initialize(GaiaConstants::kChromeOSSource, @@ -190,16 +195,6 @@ void LoginUtilsImpl::CompleteLogin(const std::string& username, } btl->AddLoginTimeMarker("TPMOwned", false); - // Take the credentials passed in and try to exchange them for - // full-fledged Google authentication cookies. This is - // best-effort; it's possible that we'll fail due to network - // troubles or some such. Either way, |cf| will call - // DoBrowserLaunch on the UI thread when it's done, and then - // delete itself. - CookieFetcher* cf = new CookieFetcher(profile); - cf->AttemptFetch(credentials.data); - btl->AddLoginTimeMarker("CookieFetchStarted", false); - static const char kFallbackInputMethodLocale[] = "en-US"; if (first_login) { std::string locale(g_browser_process->GetApplicationLocale()); @@ -234,6 +229,7 @@ void LoginUtilsImpl::CompleteLogin(const std::string& username, btl->AddLoginTimeMarker("IMESTarted", false); } } + DoBrowserLaunch(profile); } void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) { |