OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 audio_manager_.reset(media::AudioManager::Create()); | 345 audio_manager_.reset(media::AudioManager::Create()); |
346 | 346 |
347 #if !defined(OS_IOS) | 347 #if !defined(OS_IOS) |
348 // Start tracing to a file if needed. | 348 // Start tracing to a file if needed. |
349 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { | 349 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { |
350 TraceControllerImpl::GetInstance()->InitStartupTracing( | 350 TraceControllerImpl::GetInstance()->InitStartupTracing( |
351 parsed_command_line_); | 351 parsed_command_line_); |
352 } | 352 } |
353 | 353 |
354 online_state_observer_.reset(new BrowserOnlineStateObserver); | 354 online_state_observer_.reset(new BrowserOnlineStateObserver); |
| 355 #endif // !defined(OS_IOS) |
355 | 356 |
| 357 #if defined(ENABLE_PLUGINS) |
356 // Prior to any processing happening on the io thread, we create the | 358 // Prior to any processing happening on the io thread, we create the |
357 // plugin service as it is predominantly used from the io thread, | 359 // plugin service as it is predominantly used from the io thread, |
358 // but must be created on the main thread. The service ctor is | 360 // but must be created on the main thread. The service ctor is |
359 // inexpensive and does not invoke the io_thread() accessor. | 361 // inexpensive and does not invoke the io_thread() accessor. |
360 PluginService::GetInstance()->Init(); | 362 PluginService::GetInstance()->Init(); |
361 #endif // !defined(OS_IOS) | 363 #endif |
362 | 364 |
363 #if defined(OS_WIN) | 365 #if defined(OS_WIN) |
364 system_message_window_.reset(new SystemMessageWindowWin); | 366 system_message_window_.reset(new SystemMessageWindowWin); |
365 #endif | 367 #endif |
366 | 368 |
367 if (parts_.get()) | 369 if (parts_.get()) |
368 parts_->PostMainMessageLoopStart(); | 370 parts_->PostMainMessageLoopStart(); |
369 | 371 |
370 #if defined(OS_ANDROID) | 372 #if defined(OS_ANDROID) |
371 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl( | 373 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl( |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 748 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
747 if (parameters_.ui_task) | 749 if (parameters_.ui_task) |
748 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 750 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
749 | 751 |
750 base::RunLoop run_loop; | 752 base::RunLoop run_loop; |
751 run_loop.Run(); | 753 run_loop.Run(); |
752 #endif | 754 #endif |
753 } | 755 } |
754 | 756 |
755 } // namespace content | 757 } // namespace content |
OLD | NEW |