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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/browser/browser_process_sub_thread.h" | 11 #include "content/browser/browser_process_sub_thread.h" |
12 | 12 |
13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
14 #include "ui/base/win/scoped_ole_initializer.h" | 14 #include "ui/base/win/scoped_ole_initializer.h" |
15 #endif | 15 #endif |
16 | 16 |
| 17 class AudioManager; |
17 class BrowserOnlineStateObserver; | 18 class BrowserOnlineStateObserver; |
18 class CommandLine; | 19 class CommandLine; |
19 class HighResolutionTimerManager; | 20 class HighResolutionTimerManager; |
20 class MessageLoop; | 21 class MessageLoop; |
21 class SystemMessageWindowWin; | 22 class SystemMessageWindowWin; |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class SystemMonitor; | 25 class SystemMonitor; |
25 } | 26 } |
26 | 27 |
27 namespace media { | |
28 class AudioManager; | |
29 } | |
30 | |
31 namespace net { | 28 namespace net { |
32 class NetworkChangeNotifier; | 29 class NetworkChangeNotifier; |
33 } | 30 } |
34 | 31 |
35 namespace content { | 32 namespace content { |
36 | 33 |
37 class BrowserMainParts; | 34 class BrowserMainParts; |
38 class BrowserShutdownImpl; | 35 class BrowserShutdownImpl; |
39 class BrowserThreadImpl; | 36 class BrowserThreadImpl; |
40 struct MainFunctionParams; | 37 struct MainFunctionParams; |
(...skipping 21 matching lines...) Expand all Loading... |
62 // Perform the default message loop run logic. | 59 // Perform the default message loop run logic. |
63 void RunMainMessageLoopParts(); | 60 void RunMainMessageLoopParts(); |
64 | 61 |
65 // Performs the shutdown sequence, starting with PostMainMessageLoopRun | 62 // Performs the shutdown sequence, starting with PostMainMessageLoopRun |
66 // through stopping threads to PostDestroyThreads. | 63 // through stopping threads to PostDestroyThreads. |
67 void ShutdownThreadsAndCleanUp(); | 64 void ShutdownThreadsAndCleanUp(); |
68 | 65 |
69 int GetResultCode() const { return result_code_; } | 66 int GetResultCode() const { return result_code_; } |
70 | 67 |
71 // Can be called on any thread. | 68 // Can be called on any thread. |
72 static media::AudioManager* GetAudioManager(); | 69 static AudioManager* GetAudioManager(); |
73 | 70 |
74 private: | 71 private: |
75 // For ShutdownThreadsAndCleanUp. | 72 // For ShutdownThreadsAndCleanUp. |
76 friend class BrowserShutdownImpl; | 73 friend class BrowserShutdownImpl; |
77 | 74 |
78 void InitializeMainThread(); | 75 void InitializeMainThread(); |
79 | 76 |
80 // Called right after the browser threads have been started. | 77 // Called right after the browser threads have been started. |
81 void BrowserThreadsStarted(); | 78 void BrowserThreadsStarted(); |
82 | 79 |
83 void MainMessageLoopRun(); | 80 void MainMessageLoopRun(); |
84 | 81 |
85 // Members initialized on construction --------------------------------------- | 82 // Members initialized on construction --------------------------------------- |
86 const content::MainFunctionParams& parameters_; | 83 const content::MainFunctionParams& parameters_; |
87 const CommandLine& parsed_command_line_; | 84 const CommandLine& parsed_command_line_; |
88 int result_code_; | 85 int result_code_; |
89 | 86 |
90 // Members initialized in |MainMessageLoopStart()| --------------------------- | 87 // Members initialized in |MainMessageLoopStart()| --------------------------- |
91 scoped_ptr<MessageLoop> main_message_loop_; | 88 scoped_ptr<MessageLoop> main_message_loop_; |
92 scoped_ptr<base::SystemMonitor> system_monitor_; | 89 scoped_ptr<base::SystemMonitor> system_monitor_; |
93 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; | 90 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; |
94 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 91 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
95 scoped_ptr<media::AudioManager> audio_manager_; | 92 scoped_ptr<AudioManager> audio_manager_; |
96 // Per-process listener for online state changes. | 93 // Per-process listener for online state changes. |
97 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; | 94 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; |
98 #if defined(OS_WIN) | 95 #if defined(OS_WIN) |
99 scoped_ptr<SystemMessageWindowWin> system_message_window_; | 96 scoped_ptr<SystemMessageWindowWin> system_message_window_; |
100 #elif defined(OS_LINUX) | 97 #elif defined(OS_LINUX) |
101 scoped_refptr<MediaDeviceNotificationsLinux> | 98 scoped_refptr<MediaDeviceNotificationsLinux> |
102 media_device_notifications_linux_; | 99 media_device_notifications_linux_; |
103 #endif | 100 #endif |
104 | 101 |
105 // Destroy parts_ before main_message_loop_ (required) and before other | 102 // Destroy parts_ before main_message_loop_ (required) and before other |
(...skipping 19 matching lines...) Expand all Loading... |
125 #if defined(OS_WIN) | 122 #if defined(OS_WIN) |
126 ui::ScopedOleInitializer ole_initializer_; | 123 ui::ScopedOleInitializer ole_initializer_; |
127 #endif | 124 #endif |
128 | 125 |
129 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 126 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
130 }; | 127 }; |
131 | 128 |
132 } // namespace content | 129 } // namespace content |
133 | 130 |
134 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 131 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |