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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 393753002: mac: Add a profiler for startup time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from isherman, round 2. Created 6 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
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main_mac.h » ('j') | chrome/browser/chrome_browser_main_mac.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 3c23641a9a69179cc562c4ade434f139de6808c3..34fa4bc2e7bc3e67dc520c57d7ffe9de80dd7775 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -30,6 +30,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/mac/mac_startup_profiler.h"
#include "chrome/browser/profiles/profile_info_cache_observer.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profiles_state.h"
@@ -281,6 +282,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// the profile is loaded or any preferences have been registered). Defer any
// user-data initialization until -applicationDidFinishLaunching:.
- (void)awakeFromNib {
+ MacStartupProfiler::GetInstance()->Profile(
+ MacStartupProfiler::AWAKE_FROM_NIB);
// We need to register the handlers early to catch events fired on launch.
NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager];
[em setEventHandler:self
@@ -360,6 +363,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// (NSApplicationDelegate protocol) This is the Apple-approved place to override
// the default handlers.
- (void)applicationWillFinishLaunching:(NSNotification*)notification {
+ MacStartupProfiler::GetInstance()->Profile(
+ MacStartupProfiler::WILL_FINISH_LAUNCHING);
// Nothing here right now.
jeremy 2014/07/16 08:19:23 nit: Remove this comment ?
erikchen 2014/07/16 22:00:32 Done.
}
@@ -734,6 +739,10 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// This is called after profiles have been loaded and preferences registered.
// It is safe to access the default profile here.
- (void)applicationDidFinishLaunching:(NSNotification*)notify {
+ MacStartupProfiler::GetInstance()->Profile(
+ MacStartupProfiler::DID_FINISH_LAUNCHING);
+ MacStartupProfiler::GetInstance()->RecordMetrics();
+
// Notify BrowserList to keep the application running so it doesn't go away
// when all the browser windows get closed.
chrome::IncrementKeepAliveCount();
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main_mac.h » ('j') | chrome/browser/chrome_browser_main_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698