| 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) |
| 295 tracked_objects::ThreadData::InitializeThreadContext(kThreadName); | 297 tracked_objects::ThreadData::InitializeThreadContext(kThreadName); |
| 298 #endif // TRACK_ALL_TASK_OBJECTS |
| 296 | 299 |
| 297 // Register the main thread by instantiating it, but don't call any methods. | 300 // Register the main thread by instantiating it, but don't call any methods. |
| 298 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, | 301 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, |
| 299 MessageLoop::current())); | 302 MessageLoop::current())); |
| 300 } | 303 } |
| 301 | 304 |
| 302 void BrowserMainLoop::InitializeToolkit() { | 305 void BrowserMainLoop::InitializeToolkit() { |
| 303 // TODO(evan): this function is rather subtle, due to the variety | 306 // TODO(evan): this function is rather subtle, due to the variety |
| 304 // of intersecting ifdefs we have. To keep it easy to follow, there | 307 // of intersecting ifdefs we have. To keep it easy to follow, there |
| 305 // are no #else branches on any #ifs. | 308 // are no #else branches on any #ifs. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); | 362 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); |
| 360 | 363 |
| 361 #if defined(OS_MACOSX) | 364 #if defined(OS_MACOSX) |
| 362 MessageLoopForUI::current()->Run(); | 365 MessageLoopForUI::current()->Run(); |
| 363 #else | 366 #else |
| 364 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 367 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
| 365 #endif | 368 #endif |
| 366 } | 369 } |
| 367 | 370 |
| 368 } // namespace content | 371 } // namespace content |
| OLD | NEW |