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/logging.h" | 10 #include "base/logging.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 NOTIMPLEMENTED(); | 199 NOTIMPLEMENTED(); |
200 #endif | 200 #endif |
201 } | 201 } |
202 }; | 202 }; |
203 | 203 |
204 void ImmediateShutdownAndExitProcess() { | 204 void ImmediateShutdownAndExitProcess() { |
205 BrowserShutdownImpl::ImmediateShutdownAndExitProcess(); | 205 BrowserShutdownImpl::ImmediateShutdownAndExitProcess(); |
206 } | 206 } |
207 | 207 |
208 // static | 208 // static |
209 AudioManager* BrowserMainLoop::GetAudioManager() { | 209 media::AudioManager* BrowserMainLoop::GetAudioManager() { |
210 return g_current_browser_main_loop->audio_manager_.get(); | 210 return g_current_browser_main_loop->audio_manager_.get(); |
211 } | 211 } |
212 | 212 |
213 // BrowserMainLoop construction / destruction ============================= | 213 // BrowserMainLoop construction / destruction ============================= |
214 | 214 |
215 BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) | 215 BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) |
216 : parameters_(parameters), | 216 : parameters_(parameters), |
217 parsed_command_line_(parameters.command_line), | 217 parsed_command_line_(parameters.command_line), |
218 result_code_(content::RESULT_CODE_NORMAL_EXIT) { | 218 result_code_(content::RESULT_CODE_NORMAL_EXIT) { |
219 DCHECK(!g_current_browser_main_loop); | 219 DCHECK(!g_current_browser_main_loop); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // Start tracing to a file if needed. | 320 // Start tracing to a file if needed. |
321 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { | 321 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { |
322 TraceControllerImpl::GetInstance()->InitStartupTracing( | 322 TraceControllerImpl::GetInstance()->InitStartupTracing( |
323 parsed_command_line_); | 323 parsed_command_line_); |
324 } | 324 } |
325 | 325 |
326 system_monitor_.reset(new base::SystemMonitor); | 326 system_monitor_.reset(new base::SystemMonitor); |
327 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 327 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
328 | 328 |
329 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 329 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
330 audio_manager_.reset(AudioManager::Create()); | 330 audio_manager_.reset(media::AudioManager::Create()); |
331 online_state_observer_.reset(new BrowserOnlineStateObserver); | 331 online_state_observer_.reset(new BrowserOnlineStateObserver); |
332 | 332 |
333 #if defined(OS_WIN) | 333 #if defined(OS_WIN) |
334 system_message_window_.reset(new SystemMessageWindowWin); | 334 system_message_window_.reset(new SystemMessageWindowWin); |
335 #endif | 335 #endif |
336 | 336 |
337 // Prior to any processing happening on the io thread, we create the | 337 // Prior to any processing happening on the io thread, we create the |
338 // plugin service as it is predominantly used from the io thread, | 338 // plugin service as it is predominantly used from the io thread, |
339 // but must be created on the main thread. The service ctor is | 339 // but must be created on the main thread. The service ctor is |
340 // inexpensive and does not invoke the io_thread() accessor. | 340 // inexpensive and does not invoke the io_thread() accessor. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 649 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
650 | 650 |
651 #if defined(OS_MACOSX) | 651 #if defined(OS_MACOSX) |
652 MessageLoopForUI::current()->Run(); | 652 MessageLoopForUI::current()->Run(); |
653 #else | 653 #else |
654 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 654 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
655 #endif | 655 #endif |
656 } | 656 } |
657 | 657 |
658 } // namespace content | 658 } // namespace content |
OLD | NEW |