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 #include "content/public/browser/browser_main_runner.h" | 5 #include "content/public/browser/browser_main_runner.h" |
6 | 6 |
7 #include "base/allocator/allocator_shim.h" | 7 #include "base/allocator/allocator_shim.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 if (main_loop_->startup_trace_file() != | 139 if (main_loop_->startup_trace_file() != |
140 base::FilePath().AppendASCII("none")) { | 140 base::FilePath().AppendASCII("none")) { |
141 startup_profiler.reset( | 141 startup_profiler.reset( |
142 new BrowserShutdownProfileDumper(main_loop_->startup_trace_file())); | 142 new BrowserShutdownProfileDumper(main_loop_->startup_trace_file())); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 // The shutdown tracing got enabled in AttemptUserExit earlier, but someone | 146 // The shutdown tracing got enabled in AttemptUserExit earlier, but someone |
147 // needs to write the result to disc. For that a dumper needs to get created | 147 // needs to write the result to disc. For that a dumper needs to get created |
148 // which will dump the traces to disc when it gets destroyed. | 148 // which will dump the traces to disc when it gets destroyed. |
149 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 149 const base::CommandLine& command_line = |
| 150 *base::CommandLine::ForCurrentProcess(); |
150 scoped_ptr<BrowserShutdownProfileDumper> shutdown_profiler; | 151 scoped_ptr<BrowserShutdownProfileDumper> shutdown_profiler; |
151 if (command_line.HasSwitch(switches::kTraceShutdown)) { | 152 if (command_line.HasSwitch(switches::kTraceShutdown)) { |
152 shutdown_profiler.reset(new BrowserShutdownProfileDumper( | 153 shutdown_profiler.reset(new BrowserShutdownProfileDumper( |
153 BrowserShutdownProfileDumper::GetShutdownProfileFileName())); | 154 BrowserShutdownProfileDumper::GetShutdownProfileFileName())); |
154 } | 155 } |
155 | 156 |
156 { | 157 { |
157 // The trace event has to stay between profiler creation and destruction. | 158 // The trace event has to stay between profiler creation and destruction. |
158 TRACE_EVENT0("shutdown", "BrowserMainRunner"); | 159 TRACE_EVENT0("shutdown", "BrowserMainRunner"); |
159 g_exited_main_message_loop = true; | 160 g_exited_main_message_loop = true; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 194 |
194 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); | 195 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); |
195 }; | 196 }; |
196 | 197 |
197 // static | 198 // static |
198 BrowserMainRunner* BrowserMainRunner::Create() { | 199 BrowserMainRunner* BrowserMainRunner::Create() { |
199 return new BrowserMainRunnerImpl(); | 200 return new BrowserMainRunnerImpl(); |
200 } | 201 } |
201 | 202 |
202 } // namespace content | 203 } // namespace content |
OLD | NEW |