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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
18 #include "content/browser/browser_thread_impl.h" | 18 #include "content/browser/browser_thread_impl.h" |
19 #include "content/browser/download/download_file_manager.h" | 19 #include "content/browser/download/download_file_manager.h" |
20 #include "content/browser/download/save_file_manager.h" | 20 #include "content/browser/download/save_file_manager.h" |
21 #include "content/browser/gamepad/gamepad_service.h" | 21 #include "content/browser/gamepad/gamepad_service.h" |
22 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 22 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
23 #include "content/browser/gpu/gpu_process_host.h" | 23 #include "content/browser/gpu/gpu_process_host.h" |
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/net/browser_online_state_observer.h" | 27 #include "content/browser/net/browser_online_state_observer.h" |
28 #include "content/browser/plugin_service_impl.h" | 28 #include "content/browser/plugin_service_impl.h" |
29 #include "content/browser/renderer_host/media/audio_input_device_manager.h" | |
30 #include "content/browser/renderer_host/media/media_stream_manager.h" | 29 #include "content/browser/renderer_host/media/media_stream_manager.h" |
31 #include "content/browser/renderer_host/media/video_capture_manager.h" | |
32 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 30 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
33 #include "content/browser/speech/speech_recognition_manager_impl.h" | 31 #include "content/browser/speech/speech_recognition_manager_impl.h" |
34 #include "content/browser/trace_controller_impl.h" | 32 #include "content/browser/trace_controller_impl.h" |
35 #include "content/public/browser/browser_main_parts.h" | 33 #include "content/public/browser/browser_main_parts.h" |
36 #include "content/public/browser/browser_shutdown.h" | 34 #include "content/public/browser/browser_shutdown.h" |
37 #include "content/public/browser/content_browser_client.h" | 35 #include "content/public/browser/content_browser_client.h" |
38 #include "content/public/browser/gpu_data_manager.h" | 36 #include "content/public/browser/gpu_data_manager.h" |
39 #include "content/public/browser/render_process_host.h" | 37 #include "content/public/browser/render_process_host.h" |
40 #include "content/public/common/content_switches.h" | 38 #include "content/public/common/content_switches.h" |
41 #include "content/public/common/main_function_params.h" | 39 #include "content/public/common/main_function_params.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { | 330 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { |
333 TraceControllerImpl::GetInstance()->InitStartupTracing( | 331 TraceControllerImpl::GetInstance()->InitStartupTracing( |
334 parsed_command_line_); | 332 parsed_command_line_); |
335 } | 333 } |
336 | 334 |
337 system_monitor_.reset(new base::SystemMonitor); | 335 system_monitor_.reset(new base::SystemMonitor); |
338 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 336 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
339 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 337 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
340 audio_manager_.reset(media::AudioManager::Create()); | 338 audio_manager_.reset(media::AudioManager::Create()); |
341 online_state_observer_.reset(new BrowserOnlineStateObserver); | 339 online_state_observer_.reset(new BrowserOnlineStateObserver); |
342 scoped_refptr<media_stream::AudioInputDeviceManager> | 340 media_stream_manager_.reset(new media_stream::MediaStreamManager()); |
no longer working on chromium
2012/08/31 13:38:23
I understand the needs for this change.
But the r
miu
2012/09/01 01:32:00
IMHO, the change I've made makes the non-test code
| |
343 audio_input_device_manager( | |
344 new media_stream::AudioInputDeviceManager(audio_manager_.get())); | |
345 scoped_refptr<media_stream::VideoCaptureManager> video_capture_manager( | |
346 new media_stream::VideoCaptureManager()); | |
347 media_stream_manager_.reset(new media_stream::MediaStreamManager( | |
348 audio_input_device_manager, video_capture_manager)); | |
349 | 341 |
350 #if defined(OS_WIN) | 342 #if defined(OS_WIN) |
351 system_message_window_.reset(new SystemMessageWindowWin); | 343 system_message_window_.reset(new SystemMessageWindowWin); |
352 #endif | 344 #endif |
353 | 345 |
354 // Prior to any processing happening on the io thread, we create the | 346 // Prior to any processing happening on the io thread, we create the |
355 // plugin service as it is predominantly used from the io thread, | 347 // plugin service as it is predominantly used from the io thread, |
356 // but must be created on the main thread. The service ctor is | 348 // but must be created on the main thread. The service ctor is |
357 // inexpensive and does not invoke the io_thread() accessor. | 349 // inexpensive and does not invoke the io_thread() accessor. |
358 PluginService::GetInstance()->Init(); | 350 PluginService::GetInstance()->Init(); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
696 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 688 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
697 if (parameters_.ui_task) | 689 if (parameters_.ui_task) |
698 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 690 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
699 | 691 |
700 base::RunLoop run_loop; | 692 base::RunLoop run_loop; |
701 run_loop.Run(); | 693 run_loop.Run(); |
702 #endif | 694 #endif |
703 } | 695 } |
704 | 696 |
705 } // namespace content | 697 } // namespace content |
OLD | NEW |