| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // and then write it to a file to be read at startup. | 243 // 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. | 244 // We can't use prefs since all services are shutdown at this point. |
| 245 TimeDelta shutdown_delta = Time::Now() - shutdown_started_; | 245 TimeDelta shutdown_delta = Time::Now() - shutdown_started_; |
| 246 std::string shutdown_ms = | 246 std::string shutdown_ms = |
| 247 base::Int64ToString(shutdown_delta.InMilliseconds()); | 247 base::Int64ToString(shutdown_delta.InMilliseconds()); |
| 248 int len = static_cast<int>(shutdown_ms.length()) + 1; | 248 int len = static_cast<int>(shutdown_ms.length()) + 1; |
| 249 FilePath shutdown_ms_file = GetShutdownMsPath(); | 249 FilePath shutdown_ms_file = GetShutdownMsPath(); |
| 250 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); | 250 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); |
| 251 } | 251 } |
| 252 | 252 |
| 253 UnregisterURLRequestChromeJob(); | |
| 254 | |
| 255 #if defined(OS_CHROMEOS) | 253 #if defined(OS_CHROMEOS) |
| 256 BrowserList::NotifyAndTerminate(false); | 254 BrowserList::NotifyAndTerminate(false); |
| 257 #endif | 255 #endif |
| 258 | 256 |
| 259 // Clean up data sources before the UI thread is removed. | 257 ChromeURLDataManager::DeleteDataSources(); |
| 260 ChromeURLDataManager* data_manager = ChromeURLDataManager::GetInstance(); | |
| 261 if (data_manager) | |
| 262 data_manager->RemoveAllDataSources(); | |
| 263 } | 258 } |
| 264 | 259 |
| 265 void ReadLastShutdownFile( | 260 void ReadLastShutdownFile( |
| 266 ShutdownType type, | 261 ShutdownType type, |
| 267 int num_procs, | 262 int num_procs, |
| 268 int num_procs_slow) { | 263 int num_procs_slow) { |
| 269 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 264 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 270 | 265 |
| 271 FilePath shutdown_ms_file = GetShutdownMsPath(); | 266 FilePath shutdown_ms_file = GetShutdownMsPath(); |
| 272 std::string shutdown_ms_str; | 267 std::string shutdown_ms_str; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 330 |
| 336 bool ShuttingDownWithoutClosingBrowsers() { | 331 bool ShuttingDownWithoutClosingBrowsers() { |
| 337 #if defined(USE_X11) | 332 #if defined(USE_X11) |
| 338 if (GetShutdownType() == browser_shutdown::END_SESSION) | 333 if (GetShutdownType() == browser_shutdown::END_SESSION) |
| 339 return true; | 334 return true; |
| 340 #endif | 335 #endif |
| 341 return false; | 336 return false; |
| 342 } | 337 } |
| 343 | 338 |
| 344 } // namespace browser_shutdown | 339 } // namespace browser_shutdown |
| OLD | NEW |