Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3523)

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 7234014: Move code to clear web databases on shutdown to the database tracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 43e90b2d5ad36a481927febdad406e22d62bcb0c..282ffe572940c723e050bd082658cf6f6bd92b91 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -81,7 +81,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)
@@ -154,12 +153,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();
@@ -282,12 +275,6 @@ BrowserProcessImpl::~BrowserProcessImpl() {
// 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;
}
@@ -698,29 +685,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);

Powered by Google App Engine
This is Rietveld 408576698