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