OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/histogram.h" | 13 #include "base/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
| 16 #include "base/string_number_conversions.h" |
16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
17 #include "base/thread.h" | 18 #include "base/thread.h" |
18 #include "base/time.h" | 19 #include "base/time.h" |
19 #include "base/waitable_event.h" | 20 #include "base/waitable_event.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/chrome_thread.h" | 23 #include "chrome/browser/chrome_thread.h" |
23 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 24 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
24 #include "chrome/browser/first_run/first_run.h" | 25 #include "chrome/browser/first_run/first_run.h" |
25 #include "chrome/browser/jankometer.h" | 26 #include "chrome/browser/jankometer.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 #else | 202 #else |
202 NOTIMPLEMENTED(); | 203 NOTIMPLEMENTED(); |
203 #endif // !defined(OS_CHROMEOS) | 204 #endif // !defined(OS_CHROMEOS) |
204 } | 205 } |
205 | 206 |
206 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 207 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
207 // Measure total shutdown time as late in the process as possible | 208 // Measure total shutdown time as late in the process as possible |
208 // and then write it to a file to be read at startup. | 209 // and then write it to a file to be read at startup. |
209 // We can't use prefs since all services are shutdown at this point. | 210 // We can't use prefs since all services are shutdown at this point. |
210 TimeDelta shutdown_delta = Time::Now() - shutdown_started_; | 211 TimeDelta shutdown_delta = Time::Now() - shutdown_started_; |
211 std::string shutdown_ms = Int64ToString(shutdown_delta.InMilliseconds()); | 212 std::string shutdown_ms = |
| 213 base::Int64ToString(shutdown_delta.InMilliseconds()); |
212 int len = static_cast<int>(shutdown_ms.length()) + 1; | 214 int len = static_cast<int>(shutdown_ms.length()) + 1; |
213 FilePath shutdown_ms_file = GetShutdownMsPath(); | 215 FilePath shutdown_ms_file = GetShutdownMsPath(); |
214 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); | 216 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); |
215 } | 217 } |
216 | 218 |
217 UnregisterURLRequestChromeJob(); | 219 UnregisterURLRequestChromeJob(); |
218 } | 220 } |
219 | 221 |
220 void ReadLastShutdownFile( | 222 void ReadLastShutdownFile( |
221 ShutdownType type, | 223 ShutdownType type, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 284 |
283 void SetTryingToQuit(bool quitting) { | 285 void SetTryingToQuit(bool quitting) { |
284 g_trying_to_quit = quitting; | 286 g_trying_to_quit = quitting; |
285 } | 287 } |
286 | 288 |
287 bool IsTryingToQuit() { | 289 bool IsTryingToQuit() { |
288 return g_trying_to_quit; | 290 return g_trying_to_quit; |
289 } | 291 } |
290 | 292 |
291 } // namespace browser_shutdown | 293 } // namespace browser_shutdown |
OLD | NEW |