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

Unified Diff: chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc

Issue 13954002: Refactor IndexedDBInfo out of browsingdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/browsing_data/browsing_data_indexed_db_helper.cc
diff --git a/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc b/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc
index 12588af711b0978b245a1a555a9984d7547ca126..1cc2eab71bb34cbf91284098ecdaa16cec0d48b9 100644
--- a/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc
+++ b/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc
@@ -20,6 +20,7 @@
using content::BrowserThread;
using content::IndexedDBContext;
+using content::IndexedDBInfo;
using webkit_database::DatabaseUtil;
namespace {
@@ -103,17 +104,14 @@ void BrowsingDataIndexedDBHelperImpl::DeleteIndexedDB(
void BrowsingDataIndexedDBHelperImpl::FetchIndexedDBInfoInWebKitThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
- std::vector<GURL> origins = indexed_db_context_->GetAllOrigins();
- for (std::vector<GURL>::const_iterator iter = origins.begin();
+ std::vector<IndexedDBInfo> origins = indexed_db_context_->GetAllOriginsInfo();
+ for (std::vector<IndexedDBInfo>::const_iterator iter = origins.begin();
iter != origins.end(); ++iter) {
- const GURL& origin = *iter;
- if (!BrowsingDataHelper::HasWebScheme(origin))
+ const IndexedDBInfo& origin = *iter;
michaeln 2013/04/10 00:51:17 nit: maybe change this variable's name to 'info' f
+ if (!BrowsingDataHelper::HasWebScheme(origin.origin))
continue; // Non-websafe state is not considered browsing data.
- indexed_db_info_.push_back(IndexedDBInfo(
- origin,
- indexed_db_context_->GetOriginDiskUsage(origin),
- indexed_db_context_->GetOriginLastModified(origin)));
+ indexed_db_info_.push_back(origin);
}
BrowserThread::PostTask(
@@ -137,16 +135,6 @@ void BrowsingDataIndexedDBHelperImpl::DeleteIndexedDBInWebKitThread(
} // namespace
-BrowsingDataIndexedDBHelper::IndexedDBInfo::IndexedDBInfo(
- const GURL& origin,
- int64 size,
- base::Time last_modified)
- : origin(origin),
- size(size),
- last_modified(last_modified) {
-}
-
-BrowsingDataIndexedDBHelper::IndexedDBInfo::~IndexedDBInfo() {}
// static
BrowsingDataIndexedDBHelper* BrowsingDataIndexedDBHelper::Create(
@@ -239,12 +227,10 @@ void CannedBrowsingDataIndexedDBHelper::ConvertPendingInfoInWebKitThread() {
base::AutoLock auto_lock(lock_);
indexed_db_info_.clear();
for (std::set<PendingIndexedDBInfo>::const_iterator
- info = pending_indexed_db_info_.begin();
- info != pending_indexed_db_info_.end(); ++info) {
- indexed_db_info_.push_back(IndexedDBInfo(
- info->origin,
- 0,
- base::Time()));
+ pending_info = pending_indexed_db_info_.begin();
+ pending_info != pending_indexed_db_info_.end(); ++pending_info) {
+ IndexedDBInfo info = { pending_info->origin, 0, base::Time() };
+ indexed_db_info_.push_back(info);
}
BrowserThread::PostTask(
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_indexed_db_helper.h ('k') | chrome/browser/browsing_data/cookies_tree_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698