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 "chrome/browser/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void ReadLastShutdownFile(ShutdownType type, | 260 void ReadLastShutdownFile(ShutdownType type, |
261 int num_procs, | 261 int num_procs, |
262 int num_procs_slow) { | 262 int num_procs_slow) { |
263 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 263 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
264 | 264 |
265 base::FilePath shutdown_ms_file = GetShutdownMsPath(); | 265 base::FilePath shutdown_ms_file = GetShutdownMsPath(); |
266 std::string shutdown_ms_str; | 266 std::string shutdown_ms_str; |
267 int64 shutdown_ms = 0; | 267 int64 shutdown_ms = 0; |
268 if (file_util::ReadFileToString(shutdown_ms_file, &shutdown_ms_str)) | 268 if (file_util::ReadFileToString(shutdown_ms_file, &shutdown_ms_str)) |
269 base::StringToInt64(shutdown_ms_str, &shutdown_ms); | 269 base::StringToInt64(shutdown_ms_str, &shutdown_ms); |
270 base::Delete(shutdown_ms_file, false); | 270 base::DeleteFile(shutdown_ms_file, false); |
271 | 271 |
272 if (type == NOT_VALID || shutdown_ms == 0 || num_procs == 0) | 272 if (type == NOT_VALID || shutdown_ms == 0 || num_procs == 0) |
273 return; | 273 return; |
274 | 274 |
275 const char* time_fmt = "Shutdown.%s.time"; | 275 const char* time_fmt = "Shutdown.%s.time"; |
276 const char* time_per_fmt = "Shutdown.%s.time_per_process"; | 276 const char* time_per_fmt = "Shutdown.%s.time_per_process"; |
277 std::string time; | 277 std::string time; |
278 std::string time_per; | 278 std::string time_per; |
279 if (type == WINDOW_CLOSE) { | 279 if (type == WINDOW_CLOSE) { |
280 time = base::StringPrintf(time_fmt, "window_close"); | 280 time = base::StringPrintf(time_fmt, "window_close"); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 bool ShuttingDownWithoutClosingBrowsers() { | 329 bool ShuttingDownWithoutClosingBrowsers() { |
330 return g_shutting_down_without_closing_browsers; | 330 return g_shutting_down_without_closing_browsers; |
331 } | 331 } |
332 | 332 |
333 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 333 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
334 g_shutting_down_without_closing_browsers = without_close; | 334 g_shutting_down_without_closing_browsers = without_close; |
335 } | 335 } |
336 | 336 |
337 } // namespace browser_shutdown | 337 } // namespace browser_shutdown |
OLD | NEW |