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) | 23 #if defined(OS_CHROMEOS) |
24 class MemoryPressureObserverChromeOS; | 24 class MemoryPressureMonitorChromeOS; |
25 #endif | 25 #endif |
26 namespace trace_event { | 26 namespace trace_event { |
27 class TraceMemoryController; | 27 class TraceMemoryController; |
28 class TraceEventSystemStatsMonitor; | 28 class TraceEventSystemStatsMonitor; |
29 } // namespace trace_event | 29 } // namespace trace_event |
30 } // namespace base | 30 } // namespace base |
31 | 31 |
32 namespace media { | 32 namespace media { |
33 class AudioManager; | 33 class AudioManager; |
34 class MidiManager; | 34 class MidiManager; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return startup_trace_file_; | 111 return startup_trace_file_; |
112 } | 112 } |
113 | 113 |
114 void StopStartupTracingTimer(); | 114 void StopStartupTracingTimer(); |
115 | 115 |
116 #if defined(OS_MACOSX) && !defined(OS_IOS) | 116 #if defined(OS_MACOSX) && !defined(OS_IOS) |
117 DeviceMonitorMac* device_monitor_mac() const { | 117 DeviceMonitorMac* device_monitor_mac() const { |
118 return device_monitor_mac_.get(); | 118 return device_monitor_mac_.get(); |
119 } | 119 } |
120 #endif | 120 #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 | 121 |
128 private: | 122 private: |
129 class MemoryObserver; | 123 class MemoryObserver; |
130 // For ShutdownThreadsAndCleanUp. | 124 // For ShutdownThreadsAndCleanUp. |
131 friend class BrowserShutdownImpl; | 125 friend class BrowserShutdownImpl; |
132 | 126 |
133 void InitializeMainThread(); | 127 void InitializeMainThread(); |
134 | 128 |
135 // Called just before creating the threads | 129 // Called just before creating the threads |
136 int PreCreateThreads(); | 130 int PreCreateThreads(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 #elif defined(USE_UDEV) | 172 #elif defined(USE_UDEV) |
179 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; | 173 scoped_ptr<DeviceMonitorLinux> device_monitor_linux_; |
180 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 174 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
181 scoped_ptr<DeviceMonitorMac> device_monitor_mac_; | 175 scoped_ptr<DeviceMonitorMac> device_monitor_mac_; |
182 #endif | 176 #endif |
183 #if defined(OS_ANDROID) | 177 #if defined(OS_ANDROID) |
184 // Android implementation of ScreenOrientationDelegate | 178 // Android implementation of ScreenOrientationDelegate |
185 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_; | 179 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_; |
186 #endif | 180 #endif |
187 #if defined(OS_CHROMEOS) | 181 #if defined(OS_CHROMEOS) |
188 scoped_ptr<base::MemoryPressureObserverChromeOS> memory_pressure_observer_; | 182 scoped_ptr<base::MemoryPressureMonitorChromeOS> memory_pressure_monitor_; |
189 #endif | 183 #endif |
190 // The startup task runner is created by CreateStartupTasks() | 184 // The startup task runner is created by CreateStartupTasks() |
191 scoped_ptr<StartupTaskRunner> startup_task_runner_; | 185 scoped_ptr<StartupTaskRunner> startup_task_runner_; |
192 | 186 |
193 // Destroy parts_ before main_message_loop_ (required) and before other | 187 // Destroy parts_ before main_message_loop_ (required) and before other |
194 // classes constructed in content (but after main_thread_). | 188 // classes constructed in content (but after main_thread_). |
195 scoped_ptr<BrowserMainParts> parts_; | 189 scoped_ptr<BrowserMainParts> parts_; |
196 | 190 |
197 // Members initialized in |InitializeMainThread()| --------------------------- | 191 // Members initialized in |InitializeMainThread()| --------------------------- |
198 // This must get destroyed before other threads that are created in parts_. | 192 // This must get destroyed before other threads that are created in parts_. |
(...skipping 22 matching lines...) Expand all Loading... |
221 | 215 |
222 // This timer initiates trace file saving. | 216 // This timer initiates trace file saving. |
223 base::OneShotTimer<BrowserMainLoop> startup_trace_timer_; | 217 base::OneShotTimer<BrowserMainLoop> startup_trace_timer_; |
224 | 218 |
225 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 219 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
226 }; | 220 }; |
227 | 221 |
228 } // namespace content | 222 } // namespace content |
229 | 223 |
230 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 224 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |