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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 10834015: Add Startup Timing to CPM (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index b9e04d4008be5983c9f1df7e82d39e05a18d465f..17287dd5742ed795a7a8a27792c487ee7efa72d9 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/net/predictor.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
+#include "chrome/browser/performance_monitor/startup_timer.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/session_startup_pref.h"
@@ -598,8 +599,8 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs(
return false;
}
- uint32 restore_behavior = SessionRestore::SYNCHRONOUS |
- SessionRestore::ALWAYS_CREATE_TABBED_BROWSER;
+ uint32 restore_behavior = SessionRestore::SYNCHRONOUS |
+ SessionRestore::ALWAYS_CREATE_TABBED_BROWSER;
#if defined(OS_MACOSX)
// On Mac, when restoring a session with no windows, suppress the creation
// of a new window in the case where the system is launching Chrome via a
@@ -610,10 +611,18 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs(
}
#endif
+ // Pause the StartupTimer. Since the restore here is synchronous, we can
Yoyo Zhou 2012/07/31 09:57:32 This comment doesn't make sense. Maybe "we can kee
Devlin 2012/07/31 16:43:40 Done.
+ // keep these as two separate metrics - browser startup time and sesion
+ // restore time.
+ DCHECK(performance_monitor::StartupTimer::PauseTimer());
+
Browser* browser = SessionRestore::RestoreSession(profile_,
NULL,
restore_behavior,
urls_to_open);
+
+ DCHECK(performance_monitor::StartupTimer::UnpauseTimer());
+
AddInfoBarsIfNecessary(browser, chrome::startup::IS_PROCESS_STARTUP);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698