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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
13 #include "content/browser/browser_process_sub_thread.h" | 13 #include "content/browser/browser_process_sub_thread.h" |
14 #include "content/public/browser/browser_main_runner.h" | 14 #include "content/public/browser/browser_main_runner.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class CommandLine; | 17 class CommandLine; |
18 class FilePath; | 18 class FilePath; |
19 class HighResolutionTimerManager; | 19 class HighResolutionTimerManager; |
20 class MessageLoop; | 20 class MessageLoop; |
21 class PowerMonitor; | 21 class PowerMonitor; |
22 class SystemMonitor; | 22 class SystemMonitor; |
23 #if defined(OS_CHROMEOS) | |
24 class MemoryPressureObserverChromeOS; | |
25 #endif | |
26 namespace trace_event { | 23 namespace trace_event { |
27 class TraceMemoryController; | 24 class TraceMemoryController; |
28 class TraceEventSystemStatsMonitor; | 25 class TraceEventSystemStatsMonitor; |
29 } // namespace trace_event | 26 } // namespace trace_event |
30 } // namespace base | 27 } // namespace base |
31 | 28 |
32 namespace media { | 29 namespace media { |
33 class AudioManager; | 30 class AudioManager; |
34 class MidiManager; | 31 class MidiManager; |
35 class UserInputMonitor; | 32 class UserInputMonitor; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return startup_trace_file_; | 108 return startup_trace_file_; |
112 } | 109 } |
113 | 110 |
114 void StopStartupTracingTimer(); | 111 void StopStartupTracingTimer(); |
115 | 112 |
116 #if defined(OS_MACOSX) && !defined(OS_IOS) | 113 #if defined(OS_MACOSX) && !defined(OS_IOS) |
117 DeviceMonitorMac* device_monitor_mac() const { | 114 DeviceMonitorMac* device_monitor_mac() const { |
118 return device_monitor_mac_.get(); | 115 return device_monitor_mac_.get(); |
119 } | 116 } |
120 #endif | 117 #endif |
121 #if defined(OS_CHROMEOS) | |
122 // Return the MemoryPressureObserver which might be NULL. | |
123 base::MemoryPressureObserverChromeOS* memory_pressure_observer() { | |
124 return memory_pressure_observer_.get(); | |
125 } | |
126 #endif | |
127 | 118 |
128 private: | 119 private: |
129 class MemoryObserver; | 120 class MemoryObserver; |
130 // For ShutdownThreadsAndCleanUp. | 121 // For ShutdownThreadsAndCleanUp. |
131 friend class BrowserShutdownImpl; | 122 friend class BrowserShutdownImpl; |
132 | 123 |
133 void InitializeMainThread(); | 124 void InitializeMainThread(); |
134 | 125 |
135 // Called just before creating the threads | 126 // Called just before creating the threads |
136 int PreCreateThreads(); | 127 int PreCreateThreads(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 scoped_ptr<SystemMessageWindowWin> system_message_window_; | 168 scoped_ptr<SystemMessageWindowWin> system_message_window_; |
178 #elif defined(USE_UDEV) | 169 #elif defined(USE_UDEV) |
179 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; | 170 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; |
180 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 171 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
181 scoped_ptr<DeviceMonitorMac> device_monitor_mac_; | 172 scoped_ptr<DeviceMonitorMac> device_monitor_mac_; |
182 #endif | 173 #endif |
183 #if defined(OS_ANDROID) | 174 #if defined(OS_ANDROID) |
184 // Android implementation of ScreenOrientationDelegate | 175 // Android implementation of ScreenOrientationDelegate |
185 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_; | 176 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_; |
186 #endif | 177 #endif |
187 #if defined(OS_CHROMEOS) | |
188 scoped_ptr<base::MemoryPressureObserverChromeOS> memory_pressure_observer_; | |
189 #endif | |
190 // The startup task runner is created by CreateStartupTasks() | 178 // The startup task runner is created by CreateStartupTasks() |
191 scoped_ptr<StartupTaskRunner> startup_task_runner_; | 179 scoped_ptr<StartupTaskRunner> startup_task_runner_; |
192 | 180 |
193 // Destroy parts_ before main_message_loop_ (required) and before other | 181 // Destroy parts_ before main_message_loop_ (required) and before other |
194 // classes constructed in content (but after main_thread_). | 182 // classes constructed in content (but after main_thread_). |
195 scoped_ptr<BrowserMainParts> parts_; | 183 scoped_ptr<BrowserMainParts> parts_; |
196 | 184 |
197 // Members initialized in |InitializeMainThread()| --------------------------- | 185 // Members initialized in |InitializeMainThread()| --------------------------- |
198 // This must get destroyed before other threads that are created in parts_. | 186 // This must get destroyed before other threads that are created in parts_. |
199 scoped_ptr<BrowserThreadImpl> main_thread_; | 187 scoped_ptr<BrowserThreadImpl> main_thread_; |
(...skipping 21 matching lines...) Expand all Loading... |
221 | 209 |
222 // This timer initiates trace file saving. | 210 // This timer initiates trace file saving. |
223 base::OneShotTimer<BrowserMainLoop> startup_trace_timer_; | 211 base::OneShotTimer<BrowserMainLoop> startup_trace_timer_; |
224 | 212 |
225 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 213 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
226 }; | 214 }; |
227 | 215 |
228 } // namespace content | 216 } // namespace content |
229 | 217 |
230 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 218 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |