diff options
author | yiyaoliu <yiyaoliu@chromium.org> | 2015-03-18 11:04:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-18 18:05:50 +0000 |
commit | 9e6a5ab378cec3edf0eeba1b6867db055d32d2a7 (patch) | |
tree | 4795477d078e8ef6191acb8333ef24da38d0957f /content/browser/browser_main_runner.cc | |
parent | ad1d819ed2a3bdf26218f9160b94d02506dd49a0 (diff) | |
download | chromium_src-9e6a5ab378cec3edf0eeba1b6867db055d32d2a7.zip chromium_src-9e6a5ab378cec3edf0eeba1b6867db055d32d2a7.tar.gz chromium_src-9e6a5ab378cec3edf0eeba1b6867db055d32d2a7.tar.bz2 |
Profiler-instrumentation of the startup time.
Profiler recording is enabled right after command line is initialized. (We need command line to be initialized because we need get channel info first to determine whether or not to enable profiling). function is added inside ChromeMainDelegate and will be called from content.
BUG=453640
Review URL: https://codereview.chromium.org/999883002
Cr-Commit-Position: refs/heads/master@{#321166}
Diffstat (limited to 'content/browser/browser_main_runner.cc')
-rw-r--r-- | content/browser/browser_main_runner.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index b12ccd6..524bdfb 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc @@ -10,7 +10,9 @@ #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/metrics/statistics_recorder.h" +#include "base/profiler/scoped_tracker.h" #include "base/trace_event/trace_event.h" +#include "base/tracked_objects.h" #include "content/browser/browser_main_loop.h" #include "content/browser/browser_shutdown_profile_dumper.h" #include "content/browser/notification_service_impl.h" @@ -126,7 +128,14 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { } int Initialize(const MainFunctionParams& parameters) override { + // TODO(vadimt, yiyaoliu): Remove all tracked_objects references below once + // crbug.com/453640 is fixed. + tracked_objects::ThreadData::InitializeThreadContext("CrBrowserMain"); + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "453640 BrowserMainRunnerImpl::Initialize")); TRACE_EVENT0("startup", "BrowserMainRunnerImpl::Initialize"); + // On Android we normally initialize the browser in a series of UI thread // tasks. While this is happening a second request can come from the OS or // another application to start the browser. If this happens then we must |