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 29 matching lines...) Expand all Loading... |
40 #include "content/public/browser/browser_shutdown.h" | 40 #include "content/public/browser/browser_shutdown.h" |
41 #include "content/public/browser/compositor_util.h" | 41 #include "content/public/browser/compositor_util.h" |
42 #include "content/public/browser/content_browser_client.h" | 42 #include "content/public/browser/content_browser_client.h" |
43 #include "content/public/browser/render_process_host.h" | 43 #include "content/public/browser/render_process_host.h" |
44 #include "content/public/common/content_switches.h" | 44 #include "content/public/common/content_switches.h" |
45 #include "content/public/common/main_function_params.h" | 45 #include "content/public/common/main_function_params.h" |
46 #include "content/public/common/result_codes.h" | 46 #include "content/public/common/result_codes.h" |
47 #include "crypto/nss_util.h" | 47 #include "crypto/nss_util.h" |
48 #include "media/audio/audio_manager.h" | 48 #include "media/audio/audio_manager.h" |
49 #include "media/base/media.h" | 49 #include "media/base/media.h" |
| 50 #include "media/midi/midi_manager.h" |
50 #include "net/base/network_change_notifier.h" | 51 #include "net/base/network_change_notifier.h" |
51 #include "net/socket/client_socket_factory.h" | 52 #include "net/socket/client_socket_factory.h" |
52 #include "net/ssl/ssl_config_service.h" | 53 #include "net/ssl/ssl_config_service.h" |
53 #include "ui/base/clipboard/clipboard.h" | 54 #include "ui/base/clipboard/clipboard.h" |
54 | 55 |
55 #if defined(USE_AURA) | 56 #if defined(USE_AURA) |
56 #include "content/browser/renderer_host/image_transport_factory.h" | 57 #include "content/browser/renderer_host/image_transport_factory.h" |
57 #endif | 58 #endif |
58 | 59 |
59 #if defined(OS_ANDROID) | 60 #if defined(OS_ANDROID) |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 private: | 262 private: |
262 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); | 263 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); |
263 }; | 264 }; |
264 | 265 |
265 | 266 |
266 // static | 267 // static |
267 media::AudioManager* BrowserMainLoop::GetAudioManager() { | 268 media::AudioManager* BrowserMainLoop::GetAudioManager() { |
268 return g_current_browser_main_loop->audio_manager_.get(); | 269 return g_current_browser_main_loop->audio_manager_.get(); |
269 } | 270 } |
270 | 271 |
| 272 media::MIDIManager* BrowserMainLoop::GetMIDIManager() { |
| 273 return g_current_browser_main_loop->midi_manager_.get(); |
| 274 } |
| 275 |
271 // static | 276 // static |
272 AudioMirroringManager* BrowserMainLoop::GetAudioMirroringManager() { | 277 AudioMirroringManager* BrowserMainLoop::GetAudioMirroringManager() { |
273 return g_current_browser_main_loop->audio_mirroring_manager_.get(); | 278 return g_current_browser_main_loop->audio_mirroring_manager_.get(); |
274 } | 279 } |
275 | 280 |
276 // static | 281 // static |
277 MediaStreamManager* BrowserMainLoop::GetMediaStreamManager() { | 282 MediaStreamManager* BrowserMainLoop::GetMediaStreamManager() { |
278 return g_current_browser_main_loop->media_stream_manager_.get(); | 283 return g_current_browser_main_loop->media_stream_manager_.get(); |
279 } | 284 } |
280 // BrowserMainLoop construction / destruction ============================= | 285 // BrowserMainLoop construction / destruction ============================= |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } | 394 } |
390 | 395 |
391 { | 396 { |
392 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MediaFeatures") | 397 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MediaFeatures") |
393 media::InitializeCPUSpecificMediaFeatures(); | 398 media::InitializeCPUSpecificMediaFeatures(); |
394 } | 399 } |
395 { | 400 { |
396 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:AudioMan") | 401 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:AudioMan") |
397 audio_manager_.reset(media::AudioManager::Create()); | 402 audio_manager_.reset(media::AudioManager::Create()); |
398 } | 403 } |
399 | 404 { |
| 405 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MIDIManager") |
| 406 midi_manager_.reset(media::MIDIManager::Create()); |
| 407 } |
400 | 408 |
401 #if !defined(OS_IOS) | 409 #if !defined(OS_IOS) |
402 { | 410 { |
403 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:ContentWebUIController") | 411 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:ContentWebUIController") |
404 WebUIControllerFactory::RegisterFactory( | 412 WebUIControllerFactory::RegisterFactory( |
405 ContentWebUIControllerFactory::GetInstance()); | 413 ContentWebUIControllerFactory::GetInstance()); |
406 } | 414 } |
407 | 415 |
408 { | 416 { |
409 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:AudioMirroringManager") | 417 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:AudioMirroringManager") |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 if (parameters_.ui_task) | 914 if (parameters_.ui_task) |
907 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 915 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
908 *parameters_.ui_task); | 916 *parameters_.ui_task); |
909 | 917 |
910 base::RunLoop run_loop; | 918 base::RunLoop run_loop; |
911 run_loop.Run(); | 919 run_loop.Run(); |
912 #endif | 920 #endif |
913 } | 921 } |
914 | 922 |
915 } // namespace content | 923 } // namespace content |
OLD | NEW |