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 class HighResolutionTimerManager; | 13 class HighResolutionTimerManager; |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class MessageLoop; | 16 class MessageLoop; |
17 class PowerMonitor; | 17 class PowerMonitor; |
18 class SystemMonitor; | 18 class SystemMonitor; |
19 } | 19 } |
20 | 20 |
21 namespace media { | 21 namespace media { |
22 class AudioManager; | 22 class AudioManager; |
| 23 class MIDIManager; |
23 } | 24 } |
24 | 25 |
25 namespace net { | 26 namespace net { |
26 class NetworkChangeNotifier; | 27 class NetworkChangeNotifier; |
27 } | 28 } |
28 | 29 |
29 namespace content { | 30 namespace content { |
30 class AudioMirroringManager; | 31 class AudioMirroringManager; |
31 class BrowserMainParts; | 32 class BrowserMainParts; |
32 class BrowserOnlineStateObserver; | 33 class BrowserOnlineStateObserver; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void RunMainMessageLoopParts(); | 68 void RunMainMessageLoopParts(); |
68 | 69 |
69 // Performs the shutdown sequence, starting with PostMainMessageLoopRun | 70 // Performs the shutdown sequence, starting with PostMainMessageLoopRun |
70 // through stopping threads to PostDestroyThreads. | 71 // through stopping threads to PostDestroyThreads. |
71 void ShutdownThreadsAndCleanUp(); | 72 void ShutdownThreadsAndCleanUp(); |
72 | 73 |
73 int GetResultCode() const { return result_code_; } | 74 int GetResultCode() const { return result_code_; } |
74 | 75 |
75 // Can be called on any thread. | 76 // Can be called on any thread. |
76 static media::AudioManager* GetAudioManager(); | 77 static media::AudioManager* GetAudioManager(); |
| 78 static media::MIDIManager* GetMIDIManager(); |
77 static AudioMirroringManager* GetAudioMirroringManager(); | 79 static AudioMirroringManager* GetAudioMirroringManager(); |
78 static MediaStreamManager* GetMediaStreamManager(); | 80 static MediaStreamManager* GetMediaStreamManager(); |
79 | 81 |
80 private: | 82 private: |
81 // For ShutdownThreadsAndCleanUp. | 83 // For ShutdownThreadsAndCleanUp. |
82 friend class BrowserShutdownImpl; | 84 friend class BrowserShutdownImpl; |
83 | 85 |
84 void InitializeMainThread(); | 86 void InitializeMainThread(); |
85 | 87 |
86 // Called right after the browser threads have been started. | 88 // Called right after the browser threads have been started. |
87 void BrowserThreadsStarted(); | 89 void BrowserThreadsStarted(); |
88 | 90 |
89 void MainMessageLoopRun(); | 91 void MainMessageLoopRun(); |
90 | 92 |
91 // Members initialized on construction --------------------------------------- | 93 // Members initialized on construction --------------------------------------- |
92 const MainFunctionParams& parameters_; | 94 const MainFunctionParams& parameters_; |
93 const CommandLine& parsed_command_line_; | 95 const CommandLine& parsed_command_line_; |
94 int result_code_; | 96 int result_code_; |
95 | 97 |
96 // Members initialized in |MainMessageLoopStart()| --------------------------- | 98 // Members initialized in |MainMessageLoopStart()| --------------------------- |
97 scoped_ptr<base::MessageLoop> main_message_loop_; | 99 scoped_ptr<base::MessageLoop> main_message_loop_; |
98 scoped_ptr<base::SystemMonitor> system_monitor_; | 100 scoped_ptr<base::SystemMonitor> system_monitor_; |
99 scoped_ptr<base::PowerMonitor> power_monitor_; | 101 scoped_ptr<base::PowerMonitor> power_monitor_; |
100 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; | 102 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; |
101 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 103 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
102 scoped_ptr<media::AudioManager> audio_manager_; | 104 scoped_ptr<media::AudioManager> audio_manager_; |
| 105 scoped_ptr<media::MIDIManager> midi_manager_; |
103 scoped_ptr<AudioMirroringManager> audio_mirroring_manager_; | 106 scoped_ptr<AudioMirroringManager> audio_mirroring_manager_; |
104 scoped_ptr<MediaStreamManager> media_stream_manager_; | 107 scoped_ptr<MediaStreamManager> media_stream_manager_; |
105 // Per-process listener for online state changes. | 108 // Per-process listener for online state changes. |
106 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; | 109 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; |
107 #if defined(OS_WIN) | 110 #if defined(OS_WIN) |
108 scoped_ptr<SystemMessageWindowWin> system_message_window_; | 111 scoped_ptr<SystemMessageWindowWin> system_message_window_; |
109 #elif defined(OS_LINUX) | 112 #elif defined(OS_LINUX) |
110 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; | 113 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; |
111 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 114 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
112 scoped_ptr<DeviceMonitorMac> device_monitor_mac_; | 115 scoped_ptr<DeviceMonitorMac> device_monitor_mac_; |
(...skipping 22 matching lines...) Expand all Loading... |
135 scoped_ptr<BrowserProcessSubThread> cache_thread_; | 138 scoped_ptr<BrowserProcessSubThread> cache_thread_; |
136 scoped_ptr<BrowserProcessSubThread> io_thread_; | 139 scoped_ptr<BrowserProcessSubThread> io_thread_; |
137 scoped_ptr<MemoryObserver> memory_observer_; | 140 scoped_ptr<MemoryObserver> memory_observer_; |
138 | 141 |
139 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 142 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
140 }; | 143 }; |
141 | 144 |
142 } // namespace content | 145 } // namespace content |
143 | 146 |
144 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 147 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |