summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser.cc1
-rw-r--r--chrome/browser/browser_process_impl.cc35
-rw-r--r--chrome/browser/browser_process_impl.h4
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_context.cc27
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_context.h10
-rw-r--r--chrome/browser/net/sqlite_persistent_cookie_store.cc9
-rw-r--r--chrome/browser/net/sqlite_persistent_cookie_store.h4
-rw-r--r--chrome/browser/options_util.cc1
-rw-r--r--chrome/browser/views/options/cookie_filter_page_view.cc14
-rw-r--r--chrome/browser/views/options/cookie_filter_page_view.h4
-rw-r--r--chrome/common/pref_names.cc4
-rw-r--r--chrome/common/pref_names.h1
-rw-r--r--webkit/database/database_tracker.cc46
-rw-r--r--webkit/database/database_tracker.h3
14 files changed, 12 insertions, 151 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index ad5e597..e683ca8 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1370,7 +1370,6 @@ void Browser::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterStringPref(prefs::kHomePage,
ASCIIToWide(chrome::kChromeUINewTabURL));
prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true);
- prefs->RegisterBooleanPref(prefs::kClearSiteDataOnExit, false);
prefs->RegisterBooleanPref(prefs::kShowHomeButton, false);
#if defined(OS_MACOSX)
// This really belongs in platform code, but there's no good place to
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index f58357b..a63f6a4 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -21,13 +21,11 @@
#include "chrome/browser/download/save_file_manager.h"
#include "chrome/browser/google_url_tracker.h"
#include "chrome/browser/icon_manager.h"
-#include "chrome/browser/in_process_webkit/dom_storage_context.h"
#include "chrome/browser/intranet_redirect_detector.h"
#include "chrome/browser/io_thread.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/net/sdch_dictionary_fetcher.h"
-#include "chrome/browser/net/sqlite_persistent_cookie_store.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profile_manager.h"
@@ -35,15 +33,12 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/child_process_host.h"
-#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
-#include "chrome/common/url_constants.h"
#include "ipc/ipc_logging.h"
-#include "webkit/database/database_tracker.h"
#if defined(OS_WIN)
#include "views/focus/view_storage.h"
@@ -93,12 +88,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);
-
// Delete the AutomationProviderList before NotificationService,
// since it may try to unregister notifications
// Both NotificationService and AutomationProvider are singleton instances in
@@ -164,11 +153,6 @@ BrowserProcessImpl::~BrowserProcessImpl() {
// SaveFileManager and SessionService.
file_thread_.reset();
- // At this point, no render process exist, 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);
-
// With the file_thread_ flushed, we can release any icon resources.
icon_manager_.reset();
@@ -248,25 +232,6 @@ printing::PrintJobManager* BrowserProcessImpl::print_job_manager() {
return print_job_manager_.get();
}
-void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) {
- SQLitePersistentCookieStore::ClearLocalState(profile_path.Append(
- chrome::kCookieFilename));
- DOMStorageContext::ClearLocalState(profile_path, chrome::kExtensionScheme);
- webkit_database::DatabaseTracker::ClearLocalState(profile_path,
- chrome::kExtensionScheme);
- // TODO(jochen): clear app cache local state.
-}
-
-bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) {
- FilePath user_data_dir;
- Profile* profile;
-
- PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
- profile = profile_manager_->GetDefaultProfile(user_data_dir);
- *profile_path = profile->GetPath();
- return profile->GetPrefs()->GetBoolean(prefs::kClearSiteDataOnExit);
-}
-
void BrowserProcessImpl::CreateResourceDispatcherHost() {
DCHECK(!created_resource_dispatcher_host_ &&
resource_dispatcher_host_.get() == NULL);
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
index ec03c2f..e5c83e1 100644
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -26,7 +26,6 @@
#endif
class CommandLine;
-class FilePath;
class NotificationService;
// Real implementation of BrowserProcess that creates and returns the services.
@@ -213,9 +212,6 @@ class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe {
#endif
private:
- void ClearLocalState(const FilePath& profile_path);
- bool ShouldClearLocalState(FilePath* profile_path);
-
void CreateResourceDispatcherHost();
void CreatePrefService();
void CreateMetricsService();
diff --git a/chrome/browser/in_process_webkit/dom_storage_context.cc b/chrome/browser/in_process_webkit/dom_storage_context.cc
index 4156576..c19b6cf 100644
--- a/chrome/browser/in_process_webkit/dom_storage_context.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_context.cc
@@ -1,21 +1,17 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
#include "chrome/browser/in_process_webkit/dom_storage_context.h"
#include "base/file_path.h"
#include "base/file_util.h"
-#include "base/string_util.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/in_process_webkit/dom_storage_area.h"
#include "chrome/browser/in_process_webkit/dom_storage_namespace.h"
#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/common/dom_storage_common.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/webkit_glue.h"
const FilePath::CharType DOMStorageContext::kLocalStorageDirectory[] =
FILE_PATH_LITERAL("Local Storage");
@@ -240,20 +236,3 @@ void DOMStorageContext::CompleteCloningSessionStorage(
if (existing_namespace)
context->RegisterStorageNamespace(existing_namespace->Copy(clone_id));
}
-
-// static
-void DOMStorageContext::ClearLocalState(const FilePath& profile_path,
- const char* url_scheme_to_be_skip) {
- file_util::FileEnumerator file_enumerator(profile_path.Append(
- kLocalStorageDirectory), false, file_util::FileEnumerator::FILES);
- for (FilePath file_path = file_enumerator.Next(); !file_path.empty();
- file_path = file_enumerator.Next()) {
- if (file_path.Extension() == kLocalStorageExtension) {
- scoped_ptr<WebKit::WebSecurityOrigin> web_security_origin(
- WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(
- webkit_glue::FilePathToWebString(file_path.BaseName())));
- if (!EqualsASCII(web_security_origin->protocol(), url_scheme_to_be_skip))
- file_util::Delete(file_path, false);
- }
- }
-}
diff --git a/chrome/browser/in_process_webkit/dom_storage_context.h b/chrome/browser/in_process_webkit/dom_storage_context.h
index 49e3712..4981c07 100644
--- a/chrome/browser/in_process_webkit/dom_storage_context.h
+++ b/chrome/browser/in_process_webkit/dom_storage_context.h
@@ -1,6 +1,6 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
#ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_H_
#define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_H_
@@ -78,10 +78,6 @@ class DOMStorageContext {
// The local storage file extension.
static const FilePath::CharType kLocalStorageExtension[];
- // Delete all non-extension local storage files.
- static void ClearLocalState(const FilePath& profile_path,
- const char* url_scheme_to_be_skipped);
-
private:
// Get the local storage instance. The object is owned by this class.
DOMStorageNamespace* CreateLocalStorage();
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.cc b/chrome/browser/net/sqlite_persistent_cookie_store.cc
index a098c44..0216b40 100644
--- a/chrome/browser/net/sqlite_persistent_cookie_store.cc
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,7 +9,6 @@
#include "app/sql/statement.h"
#include "app/sql/transaction.h"
#include "base/basictypes.h"
-#include "base/file_util.h"
#include "base/logging.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
@@ -445,9 +444,3 @@ void SQLitePersistentCookieStore::DeleteCookie(
if (backend_.get())
backend_->DeleteCookie(cc);
}
-
-// static
-void SQLitePersistentCookieStore::ClearLocalState(
- const FilePath& path) {
- file_util::Delete(path, false);
-}
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.h b/chrome/browser/net/sqlite_persistent_cookie_store.h
index 9b12ee4..e687f02 100644
--- a/chrome/browser/net/sqlite_persistent_cookie_store.h
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -32,8 +32,6 @@ class SQLitePersistentCookieStore
const net::CookieMonster::CanonicalCookie&);
virtual void DeleteCookie(const net::CookieMonster::CanonicalCookie&);
- static void ClearLocalState(const FilePath& path);
-
private:
class Backend;
diff --git a/chrome/browser/options_util.cc b/chrome/browser/options_util.cc
index 77c9fa6..9ef6f60 100644
--- a/chrome/browser/options_util.cc
+++ b/chrome/browser/options_util.cc
@@ -23,7 +23,6 @@ void OptionsUtil::ResetToDefaults(Profile* profile) {
const wchar_t* kUserPrefs[] = {
prefs::kAcceptLanguages,
prefs::kAlternateErrorPagesEnabled,
- prefs::kClearSiteDataOnExit,
prefs::kCookieBehavior,
prefs::kDefaultCharset,
prefs::kDnsPrefetchingEnabled,
diff --git a/chrome/browser/views/options/cookie_filter_page_view.cc b/chrome/browser/views/options/cookie_filter_page_view.cc
index 835282f..a7ec450 100644
--- a/chrome/browser/views/options/cookie_filter_page_view.cc
+++ b/chrome/browser/views/options/cookie_filter_page_view.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/views/options/cookies_view.h"
#include "chrome/browser/views/options/exceptions_view.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/pref_service.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "views/controls/button/checkbox.h"
@@ -33,8 +32,6 @@ CookieFilterPageView::CookieFilterPageView(Profile* profile)
clear_on_close_check_(NULL),
show_cookies_button_(NULL),
OptionsPageView(profile) {
- clear_site_data_on_exit_.Init(prefs::kClearSiteDataOnExit,
- profile->GetPrefs(), NULL);
}
CookieFilterPageView::~CookieFilterPageView() {
@@ -131,6 +128,8 @@ void CookieFilterPageView::InitControlLayout() {
l10n_util::GetString(IDS_COOKIES_CLEAR_WHEN_CLOSE_CHKBOX));
clear_on_close_check_->set_listener(this);
+ // TODO(pkasting): Set clear-on-close checkbox to be checked or not.
+
layout->StartRow(0, single_column_set_id);
layout->AddView(clear_on_close_check_);
layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
@@ -152,13 +151,6 @@ void CookieFilterPageView::InitControlLayout() {
GridLayout::FILL);
}
-void CookieFilterPageView::NotifyPrefChanged(const std::wstring* pref_name) {
- if (!pref_name || *pref_name == prefs::kClearSiteDataOnExit) {
- clear_on_close_check_->SetChecked(
- clear_site_data_on_exit_.GetValue());
- }
-}
-
///////////////////////////////////////////////////////////////////////////////
// CookieFilterPageView, views::ButtonListener implementation:
@@ -181,7 +173,7 @@ void CookieFilterPageView::ButtonPressed(
} else if (sender == block_3rdparty_check_) {
settings_map->SetBlockThirdPartyCookies(block_3rdparty_check_->checked());
} else if (sender == clear_on_close_check_) {
- clear_site_data_on_exit_.SetValue(clear_on_close_check_->checked());
+ // TODO(pkasting): Set clear-on-close setting.
} else {
DCHECK_EQ(sender, show_cookies_button_);
UserMetricsRecordAction("Options_ShowCookies", NULL);
diff --git a/chrome/browser/views/options/cookie_filter_page_view.h b/chrome/browser/views/options/cookie_filter_page_view.h
index d2129f0..812e1dd 100644
--- a/chrome/browser/views/options/cookie_filter_page_view.h
+++ b/chrome/browser/views/options/cookie_filter_page_view.h
@@ -33,7 +33,6 @@ class CookieFilterPageView : public OptionsPageView,
private:
// OptionsPageView implementation:
virtual void InitControlLayout();
- virtual void NotifyPrefChanged(const std::wstring* pref_name);
// views::ButtonListener implementation:
virtual void ButtonPressed(views::Button* sender, const views::Event& event);
@@ -51,9 +50,6 @@ class CookieFilterPageView : public OptionsPageView,
views::Checkbox* clear_on_close_check_;
views::NativeButton* show_cookies_button_;
- // Clear locally stored site data on exit pref.
- BooleanPrefMember clear_site_data_on_exit_;
-
DISALLOW_COPY_AND_ASSIGN(CookieFilterPageView);
};
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 45ca3a1..39fdb86 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -309,10 +309,6 @@ const wchar_t kPerHostContentSettings[] = L"profile.per_host_content_settings";
// regardless of other content settings.
const wchar_t kBlockThirdPartyCookies[] = L"profile.block_third_party_cookies";
-// Boolean that is true when all locally stored site data (e.g. cookies, local
-// storage, etc..) should be deleted on exit.
-const wchar_t kClearSiteDataOnExit[] = L"profile.clear_site_data_on_exit";
-
// Dictionary that maps hostnames to zoom levels. Hosts not in this pref will
// be displayed at the default zoom level.
const wchar_t kPerHostZoomLevels[] = L"profile.per_host_zoom_levels";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 2c8cfc0..da24ab0 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -121,7 +121,6 @@ extern const wchar_t kDesktopNotificationDeniedOrigins[];
extern const wchar_t kDefaultContentSettings[];
extern const wchar_t kPerHostContentSettings[];
extern const wchar_t kBlockThirdPartyCookies[];
-extern const wchar_t kClearSiteDataOnExit[];
extern const wchar_t kPerHostZoomLevels[];
extern const wchar_t kAutoFillInfoBarShown[];
extern const wchar_t kAutoFillEnabled[];
diff --git a/webkit/database/database_tracker.cc b/webkit/database/database_tracker.cc
index 0d68633..01c3052 100644
--- a/webkit/database/database_tracker.cc
+++ b/webkit/database/database_tracker.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,11 +14,8 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/string_util.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "webkit/database/databases_table.h"
#include "webkit/database/quota_table.h"
-#include "webkit/glue/webkit_glue.h"
namespace webkit_database {
@@ -334,45 +331,4 @@ int64 DatabaseTracker::UpdateCachedDatabaseFileSize(
return new_size;
}
-// static
-void DatabaseTracker::ClearLocalState(const FilePath& profile_path,
- const char* url_scheme_to_be_skipped) {
- FilePath db_dir = profile_path.Append(FilePath(kDatabaseDirectoryName));
- FilePath db_tracker = db_dir.Append(FilePath(kTrackerDatabaseFileName));
- if (file_util::DirectoryExists(db_dir) &&
- file_util::PathExists(db_tracker)) {
- scoped_ptr<sql::Connection> db_(new sql::Connection);
- if (!db_->Open(db_tracker) ||
- !db_->DoesTableExist("Databases")) {
- db_->Close();
- file_util::Delete(db_dir, true);
- return;
- } else {
- sql::Statement delete_statement(db_->GetCachedStatement(
- SQL_FROM_HERE, "DELETE FROM Databases WHERE origin NOT LIKE ?"));
- std::string filter(url_scheme_to_be_skipped);
- filter += "_%";
- delete_statement.BindString(0, filter);
- if (!delete_statement.Run()) {
- db_->Close();
- file_util::Delete(db_dir, true);
- return;
- }
- }
- }
- file_util::FileEnumerator file_enumerator(db_dir, false,
- file_util::FileEnumerator::DIRECTORIES);
- for (FilePath file_path = file_enumerator.Next(); !file_path.empty();
- file_path = file_enumerator.Next()) {
- if (file_path.BaseName() != kTrackerDatabaseFileName) {
- scoped_ptr<WebKit::WebSecurityOrigin> web_security_origin(
- WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(
- webkit_glue::FilePathToWebString(file_path.BaseName())));
- if (!EqualsASCII(web_security_origin->protocol(),
- url_scheme_to_be_skipped))
- file_util::Delete(file_path, true);
- }
- }
-}
-
} // namespace webkit_database
diff --git a/webkit/database/database_tracker.h b/webkit/database/database_tracker.h
index 4375a35..f3f6041 100644
--- a/webkit/database/database_tracker.h
+++ b/webkit/database/database_tracker.h
@@ -116,9 +116,6 @@ class DatabaseTracker
const string16& database_name);
bool DeleteOrigin(const string16& origin_identifier);
- static void ClearLocalState(const FilePath& profile_path,
- const char* url_scheme_to_be_skipped);
-
private:
// Need this here to allow RefCountedThreadSafe to call ~DatabaseTracker().
friend class base::RefCountedThreadSafe<DatabaseTracker>;