| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 void ImmediateShutdownAndExitProcess() { | 210 void ImmediateShutdownAndExitProcess() { |
| 211 BrowserShutdownImpl::ImmediateShutdownAndExitProcess(); | 211 BrowserShutdownImpl::ImmediateShutdownAndExitProcess(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // static | 214 // static |
| 215 media::AudioManager* BrowserMainLoop::GetAudioManager() { | 215 media::AudioManager* BrowserMainLoop::GetAudioManager() { |
| 216 return g_current_browser_main_loop->audio_manager_.get(); | 216 return g_current_browser_main_loop->audio_manager_.get(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 // static | 219 // static |
| 220 media_stream::MediaStreamManager* BrowserMainLoop::GetMediaStreamManager() { | 220 MediaStreamManager* BrowserMainLoop::GetMediaStreamManager() { |
| 221 return g_current_browser_main_loop->media_stream_manager_.get(); | 221 return g_current_browser_main_loop->media_stream_manager_.get(); |
| 222 } | 222 } |
| 223 // BrowserMainLoop construction / destruction ============================= | 223 // BrowserMainLoop construction / destruction ============================= |
| 224 | 224 |
| 225 BrowserMainLoop::BrowserMainLoop(const MainFunctionParams& parameters) | 225 BrowserMainLoop::BrowserMainLoop(const MainFunctionParams& parameters) |
| 226 : parameters_(parameters), | 226 : parameters_(parameters), |
| 227 parsed_command_line_(parameters.command_line), | 227 parsed_command_line_(parameters.command_line), |
| 228 result_code_(RESULT_CODE_NORMAL_EXIT) { | 228 result_code_(RESULT_CODE_NORMAL_EXIT) { |
| 229 DCHECK(!g_current_browser_main_loop); | 229 DCHECK(!g_current_browser_main_loop); |
| 230 g_current_browser_main_loop = this; | 230 g_current_browser_main_loop = this; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 audio_manager_.reset(media::AudioManager::Create()); | 335 audio_manager_.reset(media::AudioManager::Create()); |
| 336 | 336 |
| 337 #if !defined(OS_IOS) | 337 #if !defined(OS_IOS) |
| 338 // Start tracing to a file if needed. | 338 // Start tracing to a file if needed. |
| 339 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { | 339 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { |
| 340 TraceControllerImpl::GetInstance()->InitStartupTracing( | 340 TraceControllerImpl::GetInstance()->InitStartupTracing( |
| 341 parsed_command_line_); | 341 parsed_command_line_); |
| 342 } | 342 } |
| 343 | 343 |
| 344 online_state_observer_.reset(new BrowserOnlineStateObserver); | 344 online_state_observer_.reset(new BrowserOnlineStateObserver); |
| 345 media_stream_manager_.reset( | 345 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); |
| 346 new media_stream::MediaStreamManager(audio_manager_.get())); | |
| 347 | 346 |
| 348 // Prior to any processing happening on the io thread, we create the | 347 // Prior to any processing happening on the io thread, we create the |
| 349 // plugin service as it is predominantly used from the io thread, | 348 // plugin service as it is predominantly used from the io thread, |
| 350 // but must be created on the main thread. The service ctor is | 349 // but must be created on the main thread. The service ctor is |
| 351 // inexpensive and does not invoke the io_thread() accessor. | 350 // inexpensive and does not invoke the io_thread() accessor. |
| 352 PluginService::GetInstance()->Init(); | 351 PluginService::GetInstance()->Init(); |
| 353 #endif // !defined(OS_IOS) | 352 #endif // !defined(OS_IOS) |
| 354 | 353 |
| 355 #if defined(OS_WIN) | 354 #if defined(OS_WIN) |
| 356 system_message_window_.reset(new SystemMessageWindowWin); | 355 system_message_window_.reset(new SystemMessageWindowWin); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 728 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 730 if (parameters_.ui_task) | 729 if (parameters_.ui_task) |
| 731 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 730 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
| 732 | 731 |
| 733 base::RunLoop run_loop; | 732 base::RunLoop run_loop; |
| 734 run_loop.Run(); | 733 run_loop.Run(); |
| 735 #endif | 734 #endif |
| 736 } | 735 } |
| 737 | 736 |
| 738 } // namespace content | 737 } // namespace content |
| OLD | NEW |