| 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 13 matching lines...) Expand all Loading... |
| 24 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 24 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 25 #include "content/browser/histogram_synchronizer.h" | 25 #include "content/browser/histogram_synchronizer.h" |
| 26 #include "content/browser/in_process_webkit/webkit_thread.h" | 26 #include "content/browser/in_process_webkit/webkit_thread.h" |
| 27 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 27 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 28 #include "content/browser/net/browser_online_state_observer.h" | 28 #include "content/browser/net/browser_online_state_observer.h" |
| 29 #include "content/browser/plugin_service_impl.h" | 29 #include "content/browser/plugin_service_impl.h" |
| 30 #include "content/browser/renderer_host/media/audio_mirroring_manager.h" | 30 #include "content/browser/renderer_host/media/audio_mirroring_manager.h" |
| 31 #include "content/browser/renderer_host/media/media_stream_manager.h" | 31 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 32 #include "content/browser/speech/speech_recognition_manager_impl.h" | 32 #include "content/browser/speech/speech_recognition_manager_impl.h" |
| 33 #include "content/browser/trace_controller_impl.h" | 33 #include "content/browser/trace_controller_impl.h" |
| 34 #include "content/browser/webui/content_web_ui_controller_factory.h" |
| 34 #include "content/browser/webui/url_data_manager.h" | 35 #include "content/browser/webui/url_data_manager.h" |
| 35 #include "content/public/browser/browser_main_parts.h" | 36 #include "content/public/browser/browser_main_parts.h" |
| 36 #include "content/public/browser/browser_shutdown.h" | 37 #include "content/public/browser/browser_shutdown.h" |
| 37 #include "content/public/browser/compositor_util.h" | 38 #include "content/public/browser/compositor_util.h" |
| 38 #include "content/public/browser/content_browser_client.h" | 39 #include "content/public/browser/content_browser_client.h" |
| 39 #include "content/public/browser/render_process_host.h" | 40 #include "content/public/browser/render_process_host.h" |
| 40 #include "content/public/common/content_switches.h" | 41 #include "content/public/common/content_switches.h" |
| 41 #include "content/public/common/main_function_params.h" | 42 #include "content/public/common/main_function_params.h" |
| 42 #include "content/public/common/result_codes.h" | 43 #include "content/public/common/result_codes.h" |
| 43 #include "crypto/nss_util.h" | 44 #include "crypto/nss_util.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 // Create a MessageLoop if one does not already exist for the current thread. | 330 // Create a MessageLoop if one does not already exist for the current thread. |
| 330 if (!MessageLoop::current()) | 331 if (!MessageLoop::current()) |
| 331 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 332 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
| 332 | 333 |
| 333 InitializeMainThread(); | 334 InitializeMainThread(); |
| 334 | 335 |
| 335 system_monitor_.reset(new base::SystemMonitor); | 336 system_monitor_.reset(new base::SystemMonitor); |
| 336 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 337 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
| 337 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 338 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
| 338 audio_manager_.reset(media::AudioManager::Create()); | 339 audio_manager_.reset(media::AudioManager::Create()); |
| 339 #if !defined(OS_IOS) | |
| 340 audio_mirroring_manager_.reset(new AudioMirroringManager()); | |
| 341 #endif | |
| 342 | 340 |
| 343 #if !defined(OS_IOS) | 341 #if !defined(OS_IOS) |
| 342 WebUIControllerFactory::RegisterFactory( |
| 343 ContentWebUIControllerFactory::GetInstance()); |
| 344 |
| 345 audio_mirroring_manager_.reset(new AudioMirroringManager()); |
| 346 |
| 344 // Start tracing to a file if needed. | 347 // Start tracing to a file if needed. |
| 345 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { | 348 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { |
| 346 TraceControllerImpl::GetInstance()->InitStartupTracing( | 349 TraceControllerImpl::GetInstance()->InitStartupTracing( |
| 347 parsed_command_line_); | 350 parsed_command_line_); |
| 348 } | 351 } |
| 349 | 352 |
| 350 online_state_observer_.reset(new BrowserOnlineStateObserver); | 353 online_state_observer_.reset(new BrowserOnlineStateObserver); |
| 351 #endif // !defined(OS_IOS) | 354 #endif // !defined(OS_IOS) |
| 352 | 355 |
| 353 #if defined(ENABLE_PLUGINS) | 356 #if defined(ENABLE_PLUGINS) |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 776 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 774 if (parameters_.ui_task) | 777 if (parameters_.ui_task) |
| 775 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 778 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
| 776 | 779 |
| 777 base::RunLoop run_loop; | 780 base::RunLoop run_loop; |
| 778 run_loop.Run(); | 781 run_loop.Run(); |
| 779 #endif | 782 #endif |
| 780 } | 783 } |
| 781 | 784 |
| 782 } // namespace content | 785 } // namespace content |
| OLD | NEW |