| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 ++shutdown_num_processes_slow_; | 107 ++shutdown_num_processes_slow_; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 FilePath GetShutdownMsPath() { | 111 FilePath GetShutdownMsPath() { |
| 112 FilePath shutdown_ms_file; | 112 FilePath shutdown_ms_file; |
| 113 PathService::Get(chrome::DIR_USER_DATA, &shutdown_ms_file); | 113 PathService::Get(chrome::DIR_USER_DATA, &shutdown_ms_file); |
| 114 return shutdown_ms_file.AppendASCII(kShutdownMsFile); | 114 return shutdown_ms_file.AppendASCII(kShutdownMsFile); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool ShutdownPreThreadsStop() { | 117 void Shutdown() { |
| 118 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
| 119 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker( | 119 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker( |
| 120 "BrowserShutdownStarted", false); | 120 "BrowserShutdownStarted", false); |
| 121 #endif | 121 #endif |
| 122 // During shutdown we will end up some blocking operations. But the | 122 // During shutdown we will end up some blocking operations. But the |
| 123 // work needs to get done and we're going to wait for them no matter | 123 // work needs to get done and we're going to wait for them no matter |
| 124 // what thread they're on, so don't worry about it slowing down | 124 // what thread they're on, so don't worry about it slowing down |
| 125 // shutdown. | 125 // shutdown. |
| 126 base::ThreadRestrictions::SetIOAllowed(true); | 126 base::ThreadRestrictions::SetIOAllowed(true); |
| 127 | 127 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 prefs->SavePersistentPrefs(); | 157 prefs->SavePersistentPrefs(); |
| 158 | 158 |
| 159 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 159 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
| 160 // Cleanup any statics created by RLZ. Must be done before NotificationService | 160 // Cleanup any statics created by RLZ. Must be done before NotificationService |
| 161 // is destroyed. | 161 // is destroyed. |
| 162 RLZTracker::CleanupRlz(); | 162 RLZTracker::CleanupRlz(); |
| 163 #endif | 163 #endif |
| 164 | 164 |
| 165 return restart_last_session; | |
| 166 } | |
| 167 | |
| 168 void ShutdownPostThreadsStop(bool restart_last_session) { | |
| 169 // The jank'o'meter requires that the browser process has been destroyed | 165 // The jank'o'meter requires that the browser process has been destroyed |
| 170 // before calling UninstallJankometer(). | 166 // before calling UninstallJankometer(). |
| 171 delete g_browser_process; | 167 delete g_browser_process; |
| 172 g_browser_process = NULL; | 168 g_browser_process = NULL; |
| 173 | 169 |
| 174 // crbug.com/95079 - This needs to happen after the browser process object | 170 // crbug.com/95079 - This needs to happen after the browser process object |
| 175 // goes away. | 171 // goes away. |
| 176 ProfileManager::NukeDeletedProfilesFromDisk(); | 172 ProfileManager::NukeDeletedProfilesFromDisk(); |
| 177 | 173 |
| 178 #if defined(OS_CHROMEOS) | 174 #if defined(OS_CHROMEOS) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 315 |
| 320 bool ShuttingDownWithoutClosingBrowsers() { | 316 bool ShuttingDownWithoutClosingBrowsers() { |
| 321 return g_shutting_down_without_closing_browsers; | 317 return g_shutting_down_without_closing_browsers; |
| 322 } | 318 } |
| 323 | 319 |
| 324 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 320 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
| 325 g_shutting_down_without_closing_browsers = without_close; | 321 g_shutting_down_without_closing_browsers = without_close; |
| 326 } | 322 } |
| 327 | 323 |
| 328 } // namespace browser_shutdown | 324 } // namespace browser_shutdown |
| OLD | NEW |