OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 *completed_main_message_loop = true; | 285 *completed_main_message_loop = true; |
286 | 286 |
287 for (size_t i = 0; i < parts_list_.size(); ++i) | 287 for (size_t i = 0; i < parts_list_.size(); ++i) |
288 parts_list_[i]->PostMainMessageLoopRun(); | 288 parts_list_[i]->PostMainMessageLoopRun(); |
289 } | 289 } |
290 | 290 |
291 void BrowserMainLoop::InitializeMainThread() { | 291 void BrowserMainLoop::InitializeMainThread() { |
292 const char* kThreadName = "CrBrowserMain"; | 292 const char* kThreadName = "CrBrowserMain"; |
293 base::PlatformThread::SetName(kThreadName); | 293 base::PlatformThread::SetName(kThreadName); |
294 main_message_loop_->set_thread_name(kThreadName); | 294 main_message_loop_->set_thread_name(kThreadName); |
295 | |
296 #if defined(TRACK_ALL_TASK_OBJECTS) | |
297 tracked_objects::ThreadData::InitializeThreadContext(kThreadName); | 295 tracked_objects::ThreadData::InitializeThreadContext(kThreadName); |
298 #endif // TRACK_ALL_TASK_OBJECTS | |
299 | 296 |
300 // Register the main thread by instantiating it, but don't call any methods. | 297 // Register the main thread by instantiating it, but don't call any methods. |
301 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, | 298 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, |
302 MessageLoop::current())); | 299 MessageLoop::current())); |
303 } | 300 } |
304 | 301 |
305 void BrowserMainLoop::InitializeToolkit() { | 302 void BrowserMainLoop::InitializeToolkit() { |
306 // TODO(evan): this function is rather subtle, due to the variety | 303 // TODO(evan): this function is rather subtle, due to the variety |
307 // of intersecting ifdefs we have. To keep it easy to follow, there | 304 // of intersecting ifdefs we have. To keep it easy to follow, there |
308 // are no #else branches on any #ifs. | 305 // are no #else branches on any #ifs. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); | 359 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); |
363 | 360 |
364 #if defined(OS_MACOSX) | 361 #if defined(OS_MACOSX) |
365 MessageLoopForUI::current()->Run(); | 362 MessageLoopForUI::current()->Run(); |
366 #else | 363 #else |
367 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 364 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
368 #endif | 365 #endif |
369 } | 366 } |
370 | 367 |
371 } // namespace content | 368 } // namespace content |
OLD | NEW |