| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 256 } |
| 257 | 257 |
| 258 void ReadLastShutdownFile(ShutdownType type, | 258 void ReadLastShutdownFile(ShutdownType type, |
| 259 int num_procs, | 259 int num_procs, |
| 260 int num_procs_slow) { | 260 int num_procs_slow) { |
| 261 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 261 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 262 | 262 |
| 263 base::FilePath shutdown_ms_file = GetShutdownMsPath(); | 263 base::FilePath shutdown_ms_file = GetShutdownMsPath(); |
| 264 std::string shutdown_ms_str; | 264 std::string shutdown_ms_str; |
| 265 int64 shutdown_ms = 0; | 265 int64 shutdown_ms = 0; |
| 266 if (file_util::ReadFileToString(shutdown_ms_file, &shutdown_ms_str)) | 266 if (base::ReadFileToString(shutdown_ms_file, &shutdown_ms_str)) |
| 267 base::StringToInt64(shutdown_ms_str, &shutdown_ms); | 267 base::StringToInt64(shutdown_ms_str, &shutdown_ms); |
| 268 base::DeleteFile(shutdown_ms_file, false); | 268 base::DeleteFile(shutdown_ms_file, false); |
| 269 | 269 |
| 270 if (type == NOT_VALID || shutdown_ms == 0 || num_procs == 0) | 270 if (type == NOT_VALID || shutdown_ms == 0 || num_procs == 0) |
| 271 return; | 271 return; |
| 272 | 272 |
| 273 const char* time_fmt = "Shutdown.%s.time"; | 273 const char* time_fmt = "Shutdown.%s.time"; |
| 274 const char* time_per_fmt = "Shutdown.%s.time_per_process"; | 274 const char* time_per_fmt = "Shutdown.%s.time_per_process"; |
| 275 std::string time; | 275 std::string time; |
| 276 std::string time_per; | 276 std::string time_per; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 bool ShuttingDownWithoutClosingBrowsers() { | 327 bool ShuttingDownWithoutClosingBrowsers() { |
| 328 return g_shutting_down_without_closing_browsers; | 328 return g_shutting_down_without_closing_browsers; |
| 329 } | 329 } |
| 330 | 330 |
| 331 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 331 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
| 332 g_shutting_down_without_closing_browsers = without_close; | 332 g_shutting_down_without_closing_browsers = without_close; |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace browser_shutdown | 335 } // namespace browser_shutdown |
| OLD | NEW |