| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 263 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
| 264 // Measure total shutdown time as late in the process as possible | 264 // Measure total shutdown time as late in the process as possible |
| 265 // and then write it to a file to be read at startup. | 265 // and then write it to a file to be read at startup. |
| 266 // We can't use prefs since all services are shutdown at this point. | 266 // We can't use prefs since all services are shutdown at this point. |
| 267 TimeDelta shutdown_delta = Time::Now() - *shutdown_started_; | 267 TimeDelta shutdown_delta = Time::Now() - *shutdown_started_; |
| 268 std::string shutdown_ms = | 268 std::string shutdown_ms = |
| 269 base::Int64ToString(shutdown_delta.InMilliseconds()); | 269 base::Int64ToString(shutdown_delta.InMilliseconds()); |
| 270 int len = static_cast<int>(shutdown_ms.length()) + 1; | 270 int len = static_cast<int>(shutdown_ms.length()) + 1; |
| 271 base::FilePath shutdown_ms_file = GetShutdownMsPath(); | 271 base::FilePath shutdown_ms_file = GetShutdownMsPath(); |
| 272 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); | 272 base::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); |
| 273 } | 273 } |
| 274 | 274 |
| 275 #if defined(OS_CHROMEOS) | 275 #if defined(OS_CHROMEOS) |
| 276 chrome::NotifyAndTerminate(false); | 276 chrome::NotifyAndTerminate(false); |
| 277 #endif | 277 #endif |
| 278 } | 278 } |
| 279 | 279 |
| 280 void ReadLastShutdownFile(ShutdownType type, | 280 void ReadLastShutdownFile(ShutdownType type, |
| 281 int num_procs, | 281 int num_procs, |
| 282 int num_procs_slow) { | 282 int num_procs_slow) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 348 |
| 349 bool ShuttingDownWithoutClosingBrowsers() { | 349 bool ShuttingDownWithoutClosingBrowsers() { |
| 350 return g_shutting_down_without_closing_browsers; | 350 return g_shutting_down_without_closing_browsers; |
| 351 } | 351 } |
| 352 | 352 |
| 353 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 353 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
| 354 g_shutting_down_without_closing_browsers = without_close; | 354 g_shutting_down_without_closing_browsers = without_close; |
| 355 } | 355 } |
| 356 | 356 |
| 357 } // namespace browser_shutdown | 357 } // namespace browser_shutdown |
| OLD | NEW |