| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 | 167 |
| 168 prefs->SavePersistentPrefs(); | 168 prefs->SavePersistentPrefs(); |
| 169 | 169 |
| 170 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 170 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
| 171 // Cleanup any statics created by RLZ. Must be done before NotificationService | 171 // Cleanup any statics created by RLZ. Must be done before NotificationService |
| 172 // is destroyed. | 172 // is destroyed. |
| 173 RLZTracker::CleanupRlz(); | 173 RLZTracker::CleanupRlz(); |
| 174 #endif | 174 #endif |
| 175 | 175 |
| 176 ChromeURLDataManager::PrepareForShutdown(); |
| 177 |
| 176 // The jank'o'meter requires that the browser process has been destroyed | 178 // The jank'o'meter requires that the browser process has been destroyed |
| 177 // before calling UninstallJankometer(). | 179 // before calling UninstallJankometer(). |
| 178 delete g_browser_process; | 180 delete g_browser_process; |
| 179 g_browser_process = NULL; | 181 g_browser_process = NULL; |
| 180 #if defined(OS_CHROMEOS) | 182 #if defined(OS_CHROMEOS) |
| 181 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("BrowserDeleted", | 183 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("BrowserDeleted", |
| 182 true); | 184 true); |
| 183 #endif | 185 #endif |
| 184 | 186 |
| 185 // Uninstall Jank-O-Meter here after the IO thread is no longer running. | 187 // Uninstall Jank-O-Meter here after the IO thread is no longer running. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // and then write it to a file to be read at startup. | 245 // and then write it to a file to be read at startup. |
| 244 // We can't use prefs since all services are shutdown at this point. | 246 // We can't use prefs since all services are shutdown at this point. |
| 245 TimeDelta shutdown_delta = Time::Now() - shutdown_started_; | 247 TimeDelta shutdown_delta = Time::Now() - shutdown_started_; |
| 246 std::string shutdown_ms = | 248 std::string shutdown_ms = |
| 247 base::Int64ToString(shutdown_delta.InMilliseconds()); | 249 base::Int64ToString(shutdown_delta.InMilliseconds()); |
| 248 int len = static_cast<int>(shutdown_ms.length()) + 1; | 250 int len = static_cast<int>(shutdown_ms.length()) + 1; |
| 249 FilePath shutdown_ms_file = GetShutdownMsPath(); | 251 FilePath shutdown_ms_file = GetShutdownMsPath(); |
| 250 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); | 252 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); |
| 251 } | 253 } |
| 252 | 254 |
| 253 UnregisterURLRequestChromeJob(); | |
| 254 | |
| 255 #if defined(OS_CHROMEOS) | 255 #if defined(OS_CHROMEOS) |
| 256 BrowserList::NotifyAndTerminate(false); | 256 BrowserList::NotifyAndTerminate(false); |
| 257 #endif | 257 #endif |
| 258 | 258 |
| 259 // Clean up data sources before the UI thread is removed. | 259 ChromeURLDataManager::CompleteShutdown(); |
| 260 ChromeURLDataManager* data_manager = ChromeURLDataManager::GetInstance(); | |
| 261 if (data_manager) | |
| 262 data_manager->RemoveAllDataSources(); | |
| 263 } | 260 } |
| 264 | 261 |
| 265 void ReadLastShutdownFile( | 262 void ReadLastShutdownFile( |
| 266 ShutdownType type, | 263 ShutdownType type, |
| 267 int num_procs, | 264 int num_procs, |
| 268 int num_procs_slow) { | 265 int num_procs_slow) { |
| 269 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 270 | 267 |
| 271 FilePath shutdown_ms_file = GetShutdownMsPath(); | 268 FilePath shutdown_ms_file = GetShutdownMsPath(); |
| 272 std::string shutdown_ms_str; | 269 std::string shutdown_ms_str; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 332 |
| 336 bool ShuttingDownWithoutClosingBrowsers() { | 333 bool ShuttingDownWithoutClosingBrowsers() { |
| 337 #if defined(USE_X11) | 334 #if defined(USE_X11) |
| 338 if (GetShutdownType() == browser_shutdown::END_SESSION) | 335 if (GetShutdownType() == browser_shutdown::END_SESSION) |
| 339 return true; | 336 return true; |
| 340 #endif | 337 #endif |
| 341 return false; | 338 return false; |
| 342 } | 339 } |
| 343 | 340 |
| 344 } // namespace browser_shutdown | 341 } // namespace browser_shutdown |
| OLD | NEW |