Chromium Code Reviews| Index: chrome/browser/chrome_browser_main.cc |
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
| index 6369faf66a410fc7b55ad7b9f1db27668680fbc2..2bb9274ae37df24b3bd4c8c526f7d8caa11de864 100644 |
| --- a/chrome/browser/chrome_browser_main.cc |
| +++ b/chrome/browser/chrome_browser_main.cc |
| @@ -63,6 +63,7 @@ |
| #include "chrome/browser/notifications/desktop_notification_service.h" |
| #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| #include "chrome/browser/page_cycler/page_cycler.h" |
| +#include "chrome/browser/performance_monitor/startup_timer.h" |
| #include "chrome/browser/plugin_prefs.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/prefs/pref_value_store.h" |
| @@ -568,6 +569,7 @@ ChromeBrowserMainParts::ChromeBrowserMainParts( |
| result_code_(content::RESULT_CODE_NORMAL_EXIT), |
| startup_watcher_(new StartupTimeBomb()), |
| shutdown_watcher_(new ShutdownWatcherHelper()), |
| + startup_timer_(new performance_monitor::StartupTimer()), |
| record_search_engine_(false), |
| translate_manager_(NULL), |
| profile_(NULL), |
| @@ -1939,6 +1941,9 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
| PostBrowserStart(); |
| if (parameters().ui_task) { |
| + // We end the startup timer here if we have parameters to run, because we |
| + // never start to run the main loop (where we normally stop the timer). |
| + startup_timer_->SignalStartupComplete(false); // not normal startup. |
|
Yoyo Zhou
2012/07/31 09:57:32
Looks like this could go in the if (!run_message_l
Devlin
2012/07/31 16:43:40
I thought the same thing, but the problem is that
|
| parameters().ui_task->Run(); |
| delete parameters().ui_task; |
| run_message_loop_ = false; |
| @@ -1953,10 +1958,12 @@ bool ChromeBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| if (!run_message_loop_) |
| return true; // Don't run the default message loop. |
| - // This should be invoked as close to the start of the browser's |
| + // These should be invoked as close to the start of the browser's |
| // UI thread message loop as possible to get a stable measurement |
| // across versions. |
| RecordBrowserStartupTime(); |
| + startup_timer_->SignalStartupComplete(true); // normal startup. |
| + |
| DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| #if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) |
| views::AcceleratorHandler accelerator_handler; |