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" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 media::AudioManager* audio_manager() const { return audio_manager_.get(); } | 109 media::AudioManager* audio_manager() const { return audio_manager_.get(); } |
110 MediaStreamManager* media_stream_manager() const { | 110 MediaStreamManager* media_stream_manager() const { |
111 return media_stream_manager_.get(); | 111 return media_stream_manager_.get(); |
112 } | 112 } |
113 media::UserInputMonitor* user_input_monitor() const { | 113 media::UserInputMonitor* user_input_monitor() const { |
114 return user_input_monitor_.get(); | 114 return user_input_monitor_.get(); |
115 } | 115 } |
116 media::midi::MidiManager* midi_manager() const { return midi_manager_.get(); } | 116 media::midi::MidiManager* midi_manager() const { return midi_manager_.get(); } |
117 base::Thread* indexed_db_thread() const { return indexed_db_thread_.get(); } | 117 base::Thread* indexed_db_thread() const { return indexed_db_thread_.get(); } |
118 | 118 |
119 bool is_tracing_startup() const { return is_tracing_startup_; } | 119 bool is_tracing_startup_for_duration() const { |
| 120 return is_tracing_startup_for_duration_; |
| 121 } |
120 | 122 |
121 const base::FilePath& startup_trace_file() const { | 123 const base::FilePath& startup_trace_file() const { |
122 return startup_trace_file_; | 124 return startup_trace_file_; |
123 } | 125 } |
124 | 126 |
125 void StopStartupTracingTimer(); | 127 void StopStartupTracingTimer(); |
126 | 128 |
127 #if defined(OS_MACOSX) && !defined(OS_IOS) | 129 #if defined(OS_MACOSX) && !defined(OS_IOS) |
128 DeviceMonitorMac* device_monitor_mac() const { | 130 DeviceMonitorMac* device_monitor_mac() const { |
129 return device_monitor_mac_.get(); | 131 return device_monitor_mac_.get(); |
(...skipping 15 matching lines...) Expand all Loading... |
145 | 147 |
146 // Called right after the browser threads have been started. | 148 // Called right after the browser threads have been started. |
147 int BrowserThreadsStarted(); | 149 int BrowserThreadsStarted(); |
148 | 150 |
149 int PreMainMessageLoopRun(); | 151 int PreMainMessageLoopRun(); |
150 | 152 |
151 void MainMessageLoopRun(); | 153 void MainMessageLoopRun(); |
152 | 154 |
153 base::FilePath GetStartupTraceFileName( | 155 base::FilePath GetStartupTraceFileName( |
154 const base::CommandLine& command_line) const; | 156 const base::CommandLine& command_line) const; |
155 void InitStartupTracing(const base::CommandLine& command_line); | 157 void InitStartupTracingForDuration(const base::CommandLine& command_line); |
156 void EndStartupTracing(); | 158 void EndStartupTracing(); |
157 | 159 |
158 bool UsingInProcessGpu() const; | 160 bool UsingInProcessGpu() const; |
159 | 161 |
160 // Quick reference for initialization order: | 162 // Quick reference for initialization order: |
161 // Constructor | 163 // Constructor |
162 // Init() | 164 // Init() |
163 // EarlyInitialization() | 165 // EarlyInitialization() |
164 // InitializeToolkit() | 166 // InitializeToolkit() |
165 // PreMainMessageLoopStart() | 167 // PreMainMessageLoopStart() |
166 // MainMessageLoopStart() | 168 // MainMessageLoopStart() |
167 // InitializeMainThread() | 169 // InitializeMainThread() |
168 // PostMainMessageLoopStart() | 170 // PostMainMessageLoopStart() |
169 // InitStartupTracing() | 171 // InitStartupTracingForDuration() |
170 // CreateStartupTasks() | 172 // CreateStartupTasks() |
171 // PreCreateThreads() | 173 // PreCreateThreads() |
172 // CreateThreads() | 174 // CreateThreads() |
173 // BrowserThreadsStarted() | 175 // BrowserThreadsStarted() |
174 | 176 |
175 // Members initialized on construction --------------------------------------- | 177 // Members initialized on construction --------------------------------------- |
176 const MainFunctionParams& parameters_; | 178 const MainFunctionParams& parameters_; |
177 const base::CommandLine& parsed_command_line_; | 179 const base::CommandLine& parsed_command_line_; |
178 int result_code_; | 180 int result_code_; |
179 bool created_threads_; // True if the non-UI threads were created. | 181 bool created_threads_; // True if the non-UI threads were created. |
180 bool is_tracing_startup_; | 182 bool is_tracing_startup_for_duration_; |
181 | 183 |
182 // Members initialized in |MainMessageLoopStart()| --------------------------- | 184 // Members initialized in |MainMessageLoopStart()| --------------------------- |
183 scoped_ptr<base::MessageLoop> main_message_loop_; | 185 scoped_ptr<base::MessageLoop> main_message_loop_; |
184 | 186 |
185 // Members initialized in |PostMainMessageLoopStart()| ----------------------- | 187 // Members initialized in |PostMainMessageLoopStart()| ----------------------- |
186 scoped_ptr<base::SystemMonitor> system_monitor_; | 188 scoped_ptr<base::SystemMonitor> system_monitor_; |
187 scoped_ptr<base::PowerMonitor> power_monitor_; | 189 scoped_ptr<base::PowerMonitor> power_monitor_; |
188 scoped_ptr<base::HighResolutionTimerManager> hi_res_timer_manager_; | 190 scoped_ptr<base::HighResolutionTimerManager> hi_res_timer_manager_; |
189 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 191 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
190 | 192 |
191 // Per-process listener for online state changes. | 193 // Per-process listener for online state changes. |
192 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; | 194 scoped_ptr<BrowserOnlineStateObserver> online_state_observer_; |
193 | 195 |
194 scoped_ptr<base::trace_event::TraceEventSystemStatsMonitor> | 196 scoped_ptr<base::trace_event::TraceEventSystemStatsMonitor> |
195 system_stats_monitor_; | 197 system_stats_monitor_; |
196 | 198 |
197 #if defined(OS_WIN) | 199 #if defined(OS_WIN) |
198 scoped_ptr<SystemMessageWindowWin> system_message_window_; | 200 scoped_ptr<SystemMessageWindowWin> system_message_window_; |
199 #endif | 201 #endif |
200 | 202 |
201 #if defined(OS_ANDROID) | 203 #if defined(OS_ANDROID) |
202 // Android implementation of ScreenOrientationDelegate | 204 // Android implementation of ScreenOrientationDelegate |
203 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_; | 205 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_; |
204 #endif | 206 #endif |
205 | 207 |
206 scoped_ptr<MemoryObserver> memory_observer_; | 208 scoped_ptr<MemoryObserver> memory_observer_; |
207 scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; | 209 scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; |
208 | 210 |
209 // Members initialized in |InitStartupTracing()| ----------------------------- | 211 // Members initialized in |InitStartupTracingForDuration()| ------------------ |
210 base::FilePath startup_trace_file_; | 212 base::FilePath startup_trace_file_; |
211 | 213 |
212 // This timer initiates trace file saving. | 214 // This timer initiates trace file saving. |
213 base::OneShotTimer<BrowserMainLoop> startup_trace_timer_; | 215 base::OneShotTimer<BrowserMainLoop> startup_trace_timer_; |
214 | 216 |
215 // Members initialized in |Init()| ------------------------------------------- | 217 // Members initialized in |Init()| ------------------------------------------- |
216 // Destroy |parts_| before |main_message_loop_| (required) and before other | 218 // Destroy |parts_| before |main_message_loop_| (required) and before other |
217 // classes constructed in content (but after |main_thread_|). | 219 // classes constructed in content (but after |main_thread_|). |
218 scoped_ptr<BrowserMainParts> parts_; | 220 scoped_ptr<BrowserMainParts> parts_; |
219 | 221 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 scoped_ptr<TimeZoneMonitor> time_zone_monitor_; | 263 scoped_ptr<TimeZoneMonitor> time_zone_monitor_; |
262 | 264 |
263 // DO NOT add members here. Add them to the right categories above. | 265 // DO NOT add members here. Add them to the right categories above. |
264 | 266 |
265 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 267 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
266 }; | 268 }; |
267 | 269 |
268 } // namespace content | 270 } // namespace content |
269 | 271 |
270 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 272 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |