diff options
author | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 00:55:28 +0000 |
---|---|---|
committer | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 00:55:28 +0000 |
commit | 59395014c0ac449ba9b8273800aa09965d36412c (patch) | |
tree | 99899218bc1310de33c9ecf0298a1b15c04ea8b5 /webkit/database | |
parent | 4303f91082840584199e9b79e99b6d0181ca3871 (diff) | |
download | chromium_src-59395014c0ac449ba9b8273800aa09965d36412c.zip chromium_src-59395014c0ac449ba9b8273800aa09965d36412c.tar.gz chromium_src-59395014c0ac449ba9b8273800aa09965d36412c.tar.bz2 |
Revert 37913 - Clear local state (cookies, databases, local storage) on exit.
BUG=32719
TEST=none
Review URL: http://codereview.chromium.org/564012
TBR=jochen@chromium.org
Review URL: http://codereview.chromium.org/564023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/database')
-rw-r--r-- | webkit/database/database_tracker.cc | 46 | ||||
-rw-r--r-- | webkit/database/database_tracker.h | 3 |
2 files changed, 1 insertions, 48 deletions
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>; |