diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-08 08:00:50 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-08 08:00:50 +0000 |
commit | 800ad566b10caee04ca18c7eb1796b21c1766c37 (patch) | |
tree | 276a35a8565d9bb981bb4ec656db26be3e8bce14 /chrome/browser/browser_process_impl.cc | |
parent | e6487b915297e168448ea29d81421a3f72a26c10 (diff) | |
download | chromium_src-800ad566b10caee04ca18c7eb1796b21c1766c37.zip chromium_src-800ad566b10caee04ca18c7eb1796b21c1766c37.tar.gz chromium_src-800ad566b10caee04ca18c7eb1796b21c1766c37.tar.bz2 |
Move code to clear web databases on shutdown to the database tracker
BUG=86928
TEST=test_shell_tests
Review URL: http://codereview.chromium.org/7234014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 02ff81d..f99f38b 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -80,7 +80,6 @@ #include "net/url_request/url_request_context_getter.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/l10n/l10n_util.h" -#include "webkit/database/database_tracker.h" #include "webkit/plugins/npapi/plugin_list.h" #if defined(OS_WIN) @@ -149,12 +148,6 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) } BrowserProcessImpl::~BrowserProcessImpl() { - FilePath profile_path; - bool clear_local_state_on_exit; - - // Store the profile path for clearing local state data on exit. - clear_local_state_on_exit = ShouldClearLocalState(&profile_path); - #if defined(OS_CHROMEOS) if (web_socket_proxy_thread_.get()) chromeos::WebSocketProxyController::Shutdown(); @@ -267,19 +260,9 @@ BrowserProcessImpl::~BrowserProcessImpl() { // Now OK to destroy NotificationService. main_notification_service_.reset(); - // Prior to clearing local state, we want to complete tasks pending - // on the db thread too. - db_thread_.reset(); - // Stop the watchdog thread after stopping other threads. watchdog_thread_.reset(); - // At this point, no render process exist and the file, io, db, and - // webkit threads in this process have all terminated, so it's safe - // to access local state data such as cookies, database, or local storage. - if (clear_local_state_on_exit) - ClearLocalState(profile_path); - g_browser_process = NULL; } @@ -673,29 +656,6 @@ MHTMLGenerationManager* BrowserProcessImpl::mhtml_generation_manager() { return mhtml_generation_manager_.get(); } -void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { - webkit_database::DatabaseTracker::ClearLocalState(profile_path); -} - -bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { - FilePath user_data_dir; - Profile* profile; - - // Check for the existence of a profile manager. When quitting early, - // e.g. because another chrome instance is running, or when invoked with - // options such as --uninstall or --try-chrome-again=0, the profile manager - // does not exist yet. - if (!profile_manager_.get()) - return false; - - PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); - profile = profile_manager_->GetDefaultProfile(user_data_dir); - if (!profile) - return false; - *profile_path = profile->GetPath(); - return profile->GetPrefs()->GetBoolean(prefs::kClearSiteDataOnExit); -} - void BrowserProcessImpl::CreateResourceDispatcherHost() { DCHECK(!created_resource_dispatcher_host_ && resource_dispatcher_host_.get() == NULL); |