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

Unified Diff: chrome/browser/mock_browsing_data_indexed_db_helper.cc

Issue 7692016: Delete indexedDBs from the cookie tree ui. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/mock_browsing_data_indexed_db_helper.cc
===================================================================
--- chrome/browser/mock_browsing_data_indexed_db_helper.cc (revision 97928)
+++ chrome/browser/mock_browsing_data_indexed_db_helper.cc (working copy)
@@ -7,9 +7,11 @@
#include "base/callback.h"
#include "base/logging.h"
-MockBrowsingDataIndexedDBHelper::MockBrowsingDataIndexedDBHelper(
- Profile* profile)
- : profile_(profile) {
+MockBrowsingDataIndexedDBHelper::MockBrowsingDataIndexedDBHelper()
+ : kOrigin1("http://idbhost1:1/"),
+ kOrigin2("http://idbhost2:2/"),
+ origin1_deleted_(false),
+ origin2_deleted_(false) {
Mike West 2011/08/24 08:09:00 This is certainly much more straightforward than t
michaeln 2011/08/25 01:20:04 Done.
}
MockBrowsingDataIndexedDBHelper::~MockBrowsingDataIndexedDBHelper() {
@@ -24,24 +26,22 @@
callback_.reset(NULL);
}
-void MockBrowsingDataIndexedDBHelper::DeleteIndexedDBFile(
- const FilePath& file_path) {
- CHECK(files_.find(file_path.value()) != files_.end());
- last_deleted_file_ = file_path;
- files_[file_path.value()] = false;
+void MockBrowsingDataIndexedDBHelper::DeleteIndexedDB(
+ const GURL& origin_url) {
+ CHECK(origin_url == kOrigin1 || origin_url == kOrigin2);
+ if (origin_url == kOrigin1)
+ origin1_deleted_ = true;
+ else
+ origin2_deleted_ = true;
}
void MockBrowsingDataIndexedDBHelper::AddIndexedDBSamples() {
response_.push_back(
BrowsingDataIndexedDBHelper::IndexedDBInfo(
- "http", "idbhost1", 1, "idb1", "http://idbhost1:1/",
- FilePath(FILE_PATH_LITERAL("file1")), 1, base::Time()));
- files_[FILE_PATH_LITERAL("file1")] = true;
+ kOrigin1, 1, base::Time()));
response_.push_back(
BrowsingDataIndexedDBHelper::IndexedDBInfo(
- "http", "idbhost2", 2, "idb2", "http://idbhost2:2/",
- FilePath(FILE_PATH_LITERAL("file2")), 2, base::Time()));
- files_[FILE_PATH_LITERAL("file2")] = true;
+ kOrigin2, 2, base::Time()));
}
void MockBrowsingDataIndexedDBHelper::Notify() {
@@ -50,15 +50,9 @@
}
void MockBrowsingDataIndexedDBHelper::Reset() {
- for (std::map<const FilePath::StringType, bool>::iterator i = files_.begin();
- i != files_.end(); ++i)
- i->second = true;
+ origin1_deleted_ = origin2_deleted_ = false;
}
bool MockBrowsingDataIndexedDBHelper::AllDeleted() {
- for (std::map<const FilePath::StringType, bool>::const_iterator i =
- files_.begin(); i != files_.end(); ++i)
- if (i->second)
- return false;
- return true;
+ return origin1_deleted_ && origin2_deleted_;
}

Powered by Google App Engine
This is Rietveld 408576698