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

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

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: fix test Created 5 years, 1 month 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 | « content/browser/quota/quota_manager_unittest.cc ('k') | storage/browser/quota/quota_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/quota/quota_database.h
diff --git a/storage/browser/quota/quota_database.h b/storage/browser/quota/quota_database.h
index 09e90b34bfeb4e28157144fae2dc5999f2240605..2ec6dd6e7adec98033ec63d2018e01fd86851b6a 100644
--- a/storage/browser/quota/quota_database.h
+++ b/storage/browser/quota/quota_database.h
@@ -36,6 +36,20 @@ class SpecialStoragePolicy;
// All the methods of this class must run on the DB thread.
class STORAGE_EXPORT_PRIVATE QuotaDatabase {
public:
+ struct STORAGE_EXPORT_PRIVATE OriginInfoTableEntry {
+ OriginInfoTableEntry();
+ OriginInfoTableEntry(const GURL& origin,
+ StorageType type,
+ int used_count,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time);
+ GURL origin;
+ StorageType type;
+ int used_count;
+ base::Time last_access_time;
+ base::Time last_modified_time;
+ };
+
// Constants for {Get,Set}QuotaConfigValue keys.
static const char kDesiredAvailableSpaceKey[];
static const char kTemporaryQuotaOverrideKey[];
@@ -46,7 +60,10 @@ class STORAGE_EXPORT_PRIVATE QuotaDatabase {
void CloseConnection();
+ // Returns whether the record could be found.
bool GetHostQuota(const std::string& host, StorageType type, int64* quota);
+
+ // Returns whether the operation succeeded.
bool SetHostQuota(const std::string& host, StorageType type, int64 quota);
bool DeleteHostQuota(const std::string& host, StorageType type);
@@ -58,9 +75,14 @@ class STORAGE_EXPORT_PRIVATE QuotaDatabase {
StorageType type,
base::Time last_modified_time);
+ // Gets the time |origin| was last evicted. Returns whether the record could
+ // be found.
bool GetOriginLastEvictionTime(const GURL& origin,
StorageType type,
base::Time* last_eviction_time);
+
+ // Sets the time the origin was last evicted. Returns whether the operation
+ // succeeded.
bool SetOriginLastEvictionTime(const GURL& origin,
StorageType type,
base::Time last_eviction_time);
@@ -72,6 +94,12 @@ class STORAGE_EXPORT_PRIVATE QuotaDatabase {
bool RegisterInitialOriginInfo(
const std::set<GURL>& origins, StorageType type);
+ // Gets the OriginInfoTableEntry for |origin|. Returns whether the record
+ // could be found.
+ bool GetOriginInfo(const GURL& origin,
+ StorageType type,
+ OriginInfoTableEntry* entry);
+
bool DeleteOriginInfo(const GURL& origin, StorageType type);
bool GetQuotaConfigValue(const char* key, int64* value);
@@ -87,7 +115,7 @@ class STORAGE_EXPORT_PRIVATE QuotaDatabase {
GURL* origin);
// Populates |origins| with the ones that have been modified since
- // the |modified_since|.
+ // the |modified_since|. Returns whether the operation succeeded.
bool GetOriginsModifiedSince(StorageType type,
std::set<GURL>* origins,
base::Time modified_since);
@@ -111,21 +139,6 @@ class STORAGE_EXPORT_PRIVATE QuotaDatabase {
};
friend STORAGE_EXPORT_PRIVATE bool operator <(
const QuotaTableEntry& lhs, const QuotaTableEntry& rhs);
-
- struct STORAGE_EXPORT_PRIVATE OriginInfoTableEntry {
- OriginInfoTableEntry();
- OriginInfoTableEntry(
- const GURL& origin,
- StorageType type,
- int used_count,
- const base::Time& last_access_time,
- const base::Time& last_modified_time);
- GURL origin;
- StorageType type;
- int used_count;
- base::Time last_access_time;
- base::Time last_modified_time;
- };
friend STORAGE_EXPORT_PRIVATE bool operator <(
const OriginInfoTableEntry& lhs, const OriginInfoTableEntry& rhs);
« no previous file with comments | « content/browser/quota/quota_manager_unittest.cc ('k') | storage/browser/quota/quota_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698