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

Unified Diff: chrome/browser/chrome_browser_main_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 jeremy, round two. 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 | « chrome/browser/chrome_browser_main_mac.h ('k') | chrome/browser/mac/mac_startup_profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_mac.mm
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm
index 1cf2fdb86732eea62879f6416821069c1398b10f..fa0cc60c37dc8a06ad38ae8a62cab48448e4806d 100644
--- a/chrome/browser/chrome_browser_main_mac.mm
+++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -20,6 +20,7 @@
#import "chrome/browser/chrome_browser_application_mac.h"
#include "chrome/browser/mac/install_from_dmg.h"
#import "chrome/browser/mac/keystone_glue.h"
+#include "chrome/browser/mac/mac_startup_profiler.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -175,6 +176,8 @@ void ChromeBrowserMainPartsMac::PreEarlyInitialization() {
}
void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
+ MacStartupProfiler::GetInstance()->Profile(
+ MacStartupProfiler::PRE_MAIN_MESSAGE_LOOP_START);
ChromeBrowserMainPartsPosix::PreMainMessageLoopStart();
// Tell Cocoa to finish its initialization, which we want to do manually
@@ -257,7 +260,14 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
}];
}
+void ChromeBrowserMainPartsMac::PostMainMessageLoopStart() {
+ MacStartupProfiler::GetInstance()->Profile(
+ MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START);
+}
+
void ChromeBrowserMainPartsMac::PreProfileInit() {
+ MacStartupProfiler::GetInstance()->Profile(
+ MacStartupProfiler::PRE_PROFILE_INIT);
ChromeBrowserMainPartsPosix::PreProfileInit();
// This is called here so that the app shim socket is only created after
// taking the singleton lock.
@@ -266,6 +276,8 @@ void ChromeBrowserMainPartsMac::PreProfileInit() {
}
void ChromeBrowserMainPartsMac::PostProfileInit() {
+ MacStartupProfiler::GetInstance()->Profile(
+ MacStartupProfiler::POST_PROFILE_INIT);
ChromeBrowserMainPartsPosix::PostProfileInit();
g_browser_process->metrics_service()->RecordBreakpadRegistration(
breakpad::IsCrashReporterEnabled());
« no previous file with comments | « chrome/browser/chrome_browser_main_mac.h ('k') | chrome/browser/mac/mac_startup_profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698