diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-15 23:52:45 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-15 23:52:45 +0000 |
commit | 84b57956feca7dc25c01c5b5004f6e7eba99bdcc (patch) | |
tree | 013be8da7bbfc600cfde22cb03c11439278fd473 /content/browser/browser_main.cc | |
parent | ea8bc98be00e84fc16c30e0fbc440fe9c283c56c (diff) | |
download | chromium_src-84b57956feca7dc25c01c5b5004f6e7eba99bdcc.zip chromium_src-84b57956feca7dc25c01c5b5004f6e7eba99bdcc.tar.gz chromium_src-84b57956feca7dc25c01c5b5004f6e7eba99bdcc.tar.bz2 |
Update task tracking to not depend on message_loop_ singleton
I also did a bunch of cleanup, and transitioned to tracking
the duration of a run, rather than the time from posting
(construction of a task) to completion of the run. It is
less interesting for now to track queueing delay, and we
need a focus on task execution time. I left in the hook
(API) with the expectation that I'll be extending the
tracked_objects code to include this as well.
I also landed changes to run in Linux/Mac. The fact that
I've punted on shutdown made this landing easy (all
code support was previously lost during migration to
some flavor of bind support).
r=willchan,jam,viettrungluu,ajwong
BUG=62728
Review URL: http://codereview.chromium.org/8233037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105694 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_main.cc')
-rw-r--r-- | content/browser/browser_main.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc index 75e80c3..b0c9c19 100644 --- a/content/browser/browser_main.cc +++ b/content/browser/browser_main.cc @@ -12,6 +12,7 @@ #include "base/metrics/histogram.h" #include "base/system_monitor/system_monitor.h" #include "base/threading/thread_restrictions.h" +#include "base/tracked_objects.h" #include "content/browser/browser_thread.h" #include "content/browser/content_browser_client.h" #include "content/common/hi_res_timer_manager.h" @@ -241,12 +242,11 @@ void BrowserMainParts::MainMessageLoopStart() { main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); - // TODO(viettrungluu): should these really go before setting the thread name? + InitializeMainThread(); + system_monitor_.reset(new base::SystemMonitor); hi_res_timer_manager_.reset(new HighResolutionTimerManager); - InitializeMainThread(); - network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); PostMainMessageLoopStart(); @@ -274,6 +274,10 @@ void BrowserMainParts::InitializeMainThread() { base::PlatformThread::SetName(kThreadName); main_message_loop().set_thread_name(kThreadName); +#if defined(TRACK_ALL_TASK_OBJECTS) + tracked_objects::ThreadData::InitializeThreadContext(kThreadName); +#endif // TRACK_ALL_TASK_OBJECTS + // Register the main thread by instantiating it, but don't call any methods. main_thread_.reset(new BrowserThread(BrowserThread::UI, MessageLoop::current())); |