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