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

Unified Diff: chrome/browser/browsing_data_database_helper.cc

Issue 600104: Actually delete databases in CookiesTreeModel. (Closed)
Patch Set: fixed comments Created 10 years, 10 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
« no previous file with comments | « chrome/browser/browsing_data_database_helper.h ('k') | chrome/browser/cookies_tree_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data_database_helper.cc
diff --git a/chrome/browser/browsing_data_database_helper.cc b/chrome/browser/browsing_data_database_helper.cc
index addbf93851808f0038130926ef1dee14adfef293..47489a5b0c0c3d906d081a2bbbec16298a0a0ac4 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);
}
« no previous file with comments | « chrome/browser/browsing_data_database_helper.h ('k') | chrome/browser/cookies_tree_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698