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

Unified Diff: storage/browser/quota/quota_database.cc

Issue 1424653002: Add access count and time-since-accessed histograms to temp storage eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quota_uma
Patch Set: add quota database test Created 5 years, 2 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: storage/browser/quota/quota_database.cc
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc
index f1fefb6be401860b6356daff44f4e0fdf056427c..e7757870cab802076cd5e1a66bde3cbe93f9eb20 100644
--- a/storage/browser/quota/quota_database.cc
+++ b/storage/browser/quota/quota_database.cc
@@ -357,6 +357,31 @@ bool QuotaDatabase::RegisterInitialOriginInfo(
return true;
}
+bool QuotaDatabase::GetOriginInfo(const GURL& origin,
+ StorageType type,
+ QuotaDatabase::OriginInfoTableEntry* entry) {
+ if (!LazyOpen(false))
+ return false;
+
+ const char* kSql =
+ "SELECT * FROM OriginInfoTable"
+ " WHERE origin = ? AND type = ?";
+ sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql));
+ statement.BindString(0, origin.spec());
+ statement.BindInt(1, static_cast<int>(type));
+
+ if (statement.Step()) {
+ *entry = OriginInfoTableEntry(
+ GURL(statement.ColumnString(0)),
+ static_cast<StorageType>(statement.ColumnInt(1)),
+ statement.ColumnInt(2),
+ base::Time::FromInternalValue(statement.ColumnInt64(3)),
+ base::Time::FromInternalValue(statement.ColumnInt64(4)));
+ }
+
+ return statement.Succeeded();
michaeln 2015/10/30 00:49:02 Hmmm... this will return true when nothing was fou
calamity 2015/11/02 06:27:44 The return value indicating success/error is actua
michaeln 2015/11/03 02:42:04 The return value of the new GetOriginInfo method i
calamity 2015/11/04 00:42:43 Done. Added some comments about return values.
+}
+
bool QuotaDatabase::DeleteHostQuota(
const std::string& host, StorageType type) {
if (!LazyOpen(false))

Powered by Google App Engine
This is Rietveld 408576698