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(); |