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/ref_counted.h" | 9 #include "base/memory/ref_counted.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 #include "content/public/browser/browser_main_runner.h" | 12 #include "content/public/browser/browser_main_runner.h" |
13 | 13 |
14 class CommandLine; | 14 class CommandLine; |
15 | 15 |
16 namespace base { | 16 namespace base { |
| 17 class FilePath; |
17 class HighResolutionTimerManager; | 18 class HighResolutionTimerManager; |
18 class MessageLoop; | 19 class MessageLoop; |
19 class PowerMonitor; | 20 class PowerMonitor; |
20 class SystemMonitor; | 21 class SystemMonitor; |
21 namespace debug { | 22 namespace debug { |
22 class TraceMemoryController; | 23 class TraceMemoryController; |
23 class TraceEventSystemStatsMonitor; | 24 class TraceEventSystemStatsMonitor; |
24 } // namespace debug | 25 } // namespace debug |
25 } // namespace base | 26 } // namespace base |
26 | 27 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 92 } |
92 MediaStreamManager* media_stream_manager() const { | 93 MediaStreamManager* media_stream_manager() const { |
93 return media_stream_manager_.get(); | 94 return media_stream_manager_.get(); |
94 } | 95 } |
95 media::UserInputMonitor* user_input_monitor() const { | 96 media::UserInputMonitor* user_input_monitor() const { |
96 return user_input_monitor_.get(); | 97 return user_input_monitor_.get(); |
97 } | 98 } |
98 media::MIDIManager* midi_manager() const { return midi_manager_.get(); } | 99 media::MIDIManager* midi_manager() const { return midi_manager_.get(); } |
99 base::Thread* indexed_db_thread() const { return indexed_db_thread_.get(); } | 100 base::Thread* indexed_db_thread() const { return indexed_db_thread_.get(); } |
100 | 101 |
| 102 bool is_tracing_startup() const { return is_tracing_startup_; } |
| 103 |
101 private: | 104 private: |
102 class MemoryObserver; | 105 class MemoryObserver; |
103 // For ShutdownThreadsAndCleanUp. | 106 // For ShutdownThreadsAndCleanUp. |
104 friend class BrowserShutdownImpl; | 107 friend class BrowserShutdownImpl; |
105 | 108 |
106 void InitializeMainThread(); | 109 void InitializeMainThread(); |
107 | 110 |
108 // Called just before creating the threads | 111 // Called just before creating the threads |
109 int PreCreateThreads(); | 112 int PreCreateThreads(); |
110 | 113 |
111 // Create all secondary threads. | 114 // Create all secondary threads. |
112 int CreateThreads(); | 115 int CreateThreads(); |
113 | 116 |
114 // Called right after the browser threads have been started. | 117 // Called right after the browser threads have been started. |
115 int BrowserThreadsStarted(); | 118 int BrowserThreadsStarted(); |
116 | 119 |
117 int PreMainMessageLoopRun(); | 120 int PreMainMessageLoopRun(); |
118 | 121 |
119 void MainMessageLoopRun(); | 122 void MainMessageLoopRun(); |
120 | 123 |
| 124 void InitStartupTracing(const CommandLine& command_line); |
| 125 void EndStartupTracing(const base::FilePath& trace_file); |
| 126 |
121 // Members initialized on construction --------------------------------------- | 127 // Members initialized on construction --------------------------------------- |
122 const MainFunctionParams& parameters_; | 128 const MainFunctionParams& parameters_; |
123 const CommandLine& parsed_command_line_; | 129 const CommandLine& parsed_command_line_; |
124 int result_code_; | 130 int result_code_; |
125 // True if the non-UI threads were created. | 131 // True if the non-UI threads were created. |
126 bool created_threads_; | 132 bool created_threads_; |
127 | 133 |
128 // Members initialized in |MainMessageLoopStart()| --------------------------- | 134 // Members initialized in |MainMessageLoopStart()| --------------------------- |
129 scoped_ptr<base::MessageLoop> main_message_loop_; | 135 scoped_ptr<base::MessageLoop> main_message_loop_; |
130 scoped_ptr<base::SystemMonitor> system_monitor_; | 136 scoped_ptr<base::SystemMonitor> system_monitor_; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_; | 172 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_; |
167 scoped_ptr<BrowserProcessSubThread> file_thread_; | 173 scoped_ptr<BrowserProcessSubThread> file_thread_; |
168 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_; | 174 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_; |
169 scoped_ptr<BrowserProcessSubThread> cache_thread_; | 175 scoped_ptr<BrowserProcessSubThread> cache_thread_; |
170 scoped_ptr<BrowserProcessSubThread> io_thread_; | 176 scoped_ptr<BrowserProcessSubThread> io_thread_; |
171 scoped_ptr<base::Thread> indexed_db_thread_; | 177 scoped_ptr<base::Thread> indexed_db_thread_; |
172 scoped_ptr<MemoryObserver> memory_observer_; | 178 scoped_ptr<MemoryObserver> memory_observer_; |
173 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; | 179 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; |
174 scoped_ptr<base::debug::TraceEventSystemStatsMonitor> system_stats_monitor_; | 180 scoped_ptr<base::debug::TraceEventSystemStatsMonitor> system_stats_monitor_; |
175 | 181 |
| 182 bool is_tracing_startup_; |
| 183 |
176 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 184 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
177 }; | 185 }; |
178 | 186 |
179 } // namespace content | 187 } // namespace content |
180 | 188 |
181 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 189 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |