Chromium Code Reviews| Index: content/browser/browser_main.cc |
| =================================================================== |
| --- content/browser/browser_main.cc (revision 104925) |
| +++ content/browser/browser_main.cc (working copy) |
| @@ -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/content_switches.h" |
| @@ -241,12 +242,11 @@ |
| 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(); |
|
jar (doing other things)
2011/10/14 02:29:53
I had to move this so that we wouldn't create task
|
| - |
| network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
| PostMainMessageLoopStart(); |
| @@ -274,6 +274,11 @@ |
| base::PlatformThread::SetName(kThreadName); |
| main_message_loop().set_thread_name(kThreadName); |
| +#if defined(TRACK_ALL_TASK_OBJECTS) |
| + // This must be set before *any* tasks are constructed on this main thread. |
| + tracked_objects::ThreadData::FactoryGet(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())); |