| 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 #ifndef CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
| 6 #define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 6 #define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/browser_process_sub_thread.h" | 10 #include "content/browser/browser_process_sub_thread.h" |
| 11 | 11 |
| 12 class CommandLine; | 12 class CommandLine; |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class HighResolutionTimerManager; | 15 class HighResolutionTimerManager; |
| 16 class MessageLoop; | 16 class MessageLoop; |
| 17 class PowerMonitor; | 17 class PowerMonitor; |
| 18 class SystemMonitor; | 18 class SystemMonitor; |
| 19 namespace debug { | 19 namespace debug { |
| 20 class TraceMemoryController; | 20 class TraceMemoryController; |
| 21 } // namespace debug | 21 } // namespace debug |
| 22 } // namespace base | 22 } // namespace base |
| 23 | 23 |
| 24 namespace media { | 24 namespace media { |
| 25 class AudioManager; | 25 class AudioManager; |
| 26 class KeyPressMonitor; |
| 26 class MIDIManager; | 27 class MIDIManager; |
| 27 } // namespace media | 28 } // namespace media |
| 28 | 29 |
| 29 namespace net { | 30 namespace net { |
| 30 class NetworkChangeNotifier; | 31 class NetworkChangeNotifier; |
| 31 } // namespace net | 32 } // namespace net |
| 32 | 33 |
| 33 namespace content { | 34 namespace content { |
| 34 class AudioMirroringManager; | 35 class AudioMirroringManager; |
| 35 class BrowserMainParts; | 36 class BrowserMainParts; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 78 |
| 78 int GetResultCode() const { return result_code_; } | 79 int GetResultCode() const { return result_code_; } |
| 79 | 80 |
| 80 media::AudioManager* audio_manager() const { return audio_manager_.get(); } | 81 media::AudioManager* audio_manager() const { return audio_manager_.get(); } |
| 81 AudioMirroringManager* audio_mirroring_manager() const { | 82 AudioMirroringManager* audio_mirroring_manager() const { |
| 82 return audio_mirroring_manager_.get(); | 83 return audio_mirroring_manager_.get(); |
| 83 } | 84 } |
| 84 MediaStreamManager* media_stream_manager() const { | 85 MediaStreamManager* media_stream_manager() const { |
| 85 return media_stream_manager_.get(); | 86 return media_stream_manager_.get(); |
| 86 } | 87 } |
| 88 media::KeyPressMonitor* key_press_monitor() const { |
| 89 return key_press_monitor_.get(); |
| 90 } |
| 87 media::MIDIManager* midi_manager() const { return midi_manager_.get(); } | 91 media::MIDIManager* midi_manager() const { return midi_manager_.get(); } |
| 88 base::Thread* indexed_db_thread() const { return indexed_db_thread_.get(); } | 92 base::Thread* indexed_db_thread() const { return indexed_db_thread_.get(); } |
| 89 | 93 |
| 90 private: | 94 private: |
| 91 class MemoryObserver; | 95 class MemoryObserver; |
| 92 // For ShutdownThreadsAndCleanUp. | 96 // For ShutdownThreadsAndCleanUp. |
| 93 friend class BrowserShutdownImpl; | 97 friend class BrowserShutdownImpl; |
| 94 | 98 |
| 95 void InitializeMainThread(); | 99 void InitializeMainThread(); |
| 96 | 100 |
| 97 // Called right after the browser threads have been started. | 101 // Called right after the browser threads have been started. |
| 98 void BrowserThreadsStarted(); | 102 void BrowserThreadsStarted(); |
| 99 | 103 |
| 100 void MainMessageLoopRun(); | 104 void MainMessageLoopRun(); |
| 101 | 105 |
| 102 // Members initialized on construction --------------------------------------- | 106 // Members initialized on construction --------------------------------------- |
| 103 const MainFunctionParams& parameters_; | 107 const MainFunctionParams& parameters_; |
| 104 const CommandLine& parsed_command_line_; | 108 const CommandLine& parsed_command_line_; |
| 105 int result_code_; | 109 int result_code_; |
| 106 | 110 |
| 107 // Members initialized in |MainMessageLoopStart()| --------------------------- | 111 // Members initialized in |MainMessageLoopStart()| --------------------------- |
| 108 scoped_ptr<base::MessageLoop> main_message_loop_; | 112 scoped_ptr<base::MessageLoop> main_message_loop_; |
| 109 scoped_ptr<base::SystemMonitor> system_monitor_; | 113 scoped_ptr<base::SystemMonitor> system_monitor_; |
| 110 scoped_ptr<base::PowerMonitor> power_monitor_; | 114 scoped_ptr<base::PowerMonitor> power_monitor_; |
| 111 scoped_ptr<base::HighResolutionTimerManager> hi_res_timer_manager_; | 115 scoped_ptr<base::HighResolutionTimerManager> hi_res_timer_manager_; |
| 112 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 116 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 113 scoped_ptr<media::AudioManager> audio_manager_; | 117 scoped_ptr<media::AudioManager> audio_manager_; |
| 118 scoped_ptr<media::KeyPressMonitor> key_press_monitor_; |
| 114 scoped_ptr<media::MIDIManager> midi_manager_; | 119 scoped_ptr<media::MIDIManager> midi_manager_; |
| 115 scoped_ptr<AudioMirroringManager> audio_mirroring_manager_; | 120 scoped_ptr<AudioMirroringManager> audio_mirroring_manager_; |
| 116 scoped_ptr<MediaStreamManager> media_stream_manager_; | 121 scoped_ptr<MediaStreamManager> media_stream_manager_; |
| 117 // Per-process listener for online state changes. | 122 // Per-process listener for online state changes. |
| 118 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; | 123 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; |
| 119 #if defined(OS_WIN) | 124 #if defined(OS_WIN) |
| 120 scoped_ptr<SystemMessageWindowWin> system_message_window_; | 125 scoped_ptr<SystemMessageWindowWin> system_message_window_; |
| 121 #elif defined(OS_LINUX) | 126 #elif defined(OS_LINUX) |
| 122 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; | 127 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; |
| 123 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 128 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 146 scoped_ptr<base::Thread> indexed_db_thread_; | 151 scoped_ptr<base::Thread> indexed_db_thread_; |
| 147 scoped_ptr<MemoryObserver> memory_observer_; | 152 scoped_ptr<MemoryObserver> memory_observer_; |
| 148 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; | 153 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; |
| 149 | 154 |
| 150 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 155 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
| 151 }; | 156 }; |
| 152 | 157 |
| 153 } // namespace content | 158 } // namespace content |
| 154 | 159 |
| 155 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 160 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
| OLD | NEW |