summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browsing_data_database_helper.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 10:02:26 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 10:02:26 +0000
commitec3d1456bdbfd7d7806e51dd1e59088f691495ec (patch)
tree7f85308cde8eab9ffebcb4910894c184060ba15f /chrome/browser/browsing_data_database_helper.cc
parent4236df757e45014700da962b9a20d46f61b4440f (diff)
downloadchromium_src-ec3d1456bdbfd7d7806e51dd1e59088f691495ec.zip
chromium_src-ec3d1456bdbfd7d7806e51dd1e59088f691495ec.tar.gz
chromium_src-ec3d1456bdbfd7d7806e51dd1e59088f691495ec.tar.bz2
Actually delete databases in CookiesTreeModel.
BUG=34633 TEST=delete a database while it's opened in the renderer Review URL: http://codereview.chromium.org/600104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_database_helper.cc')
-rw-r--r--chrome/browser/browsing_data_database_helper.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/browser/browsing_data_database_helper.cc b/chrome/browser/browsing_data_database_helper.cc
index addbf93..47489a5 100644
--- a/chrome/browser/browsing_data_database_helper.cc
+++ b/chrome/browser/browsing_data_database_helper.cc
@@ -8,17 +8,16 @@
#include "base/message_loop.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/profile.h"
+#include "net/base/net_errors.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCString.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
-#include "webkit/database/database_tracker.h"
#include "webkit/glue/webkit_glue.h"
BrowsingDataDatabaseHelper::BrowsingDataDatabaseHelper(Profile* profile)
- : profile_(profile),
+ : tracker_(profile->GetDatabaseTracker()),
completion_callback_(NULL),
is_fetching_(false) {
- DCHECK(profile_);
}
BrowsingDataDatabaseHelper::~BrowsingDataDatabaseHelper() {
@@ -52,9 +51,7 @@ void BrowsingDataDatabaseHelper::DeleteDatabase(const std::string& origin,
void BrowsingDataDatabaseHelper::FetchDatabaseInfoInFileThread() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
std::vector<webkit_database::OriginInfo> origins_info;
- scoped_refptr<webkit_database::DatabaseTracker> tracker =
- profile_->GetDatabaseTracker();
- if (tracker.get() && tracker->GetAllOriginsInfo(&origins_info)) {
+ if (tracker_.get() && tracker_->GetAllOriginsInfo(&origins_info)) {
for (std::vector<webkit_database::OriginInfo>::const_iterator ori =
origins_info.begin(); ori != origins_info.end(); ++ori) {
scoped_ptr<WebKit::WebSecurityOrigin> web_security_origin(
@@ -64,7 +61,7 @@ void BrowsingDataDatabaseHelper::FetchDatabaseInfoInFileThread() {
ori->GetAllDatabaseNames(&databases);
for (std::vector<string16>::const_iterator db = databases.begin();
db != databases.end(); ++db) {
- FilePath file_path = tracker->GetFullDBFilePath(ori->GetOrigin(), *db);
+ FilePath file_path = tracker_->GetFullDBFilePath(ori->GetOrigin(), *db);
file_util::FileInfo file_info;
if (file_util::GetFileInfo(file_path, &file_info)) {
database_info_.push_back(DatabaseInfo(
@@ -98,5 +95,7 @@ void BrowsingDataDatabaseHelper::DeleteDatabaseInFileThread(
const std::string& origin,
const std::string& name) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- // TODO(jochen): delete the given database.
+ if (!tracker_.get())
+ return;
+ tracker_->DeleteDatabase(UTF8ToUTF16(origin), UTF8ToUTF16(name), NULL);
}