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

Unified Diff: components/precache/core/precache_session_table.h

Issue 2335913002: Add daily quota for precache (Closed)
Patch Set: Added quota proto Created 4 years, 3 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: components/precache/core/precache_session_table.h
diff --git a/components/precache/core/precache_session_table.h b/components/precache/core/precache_session_table.h
index ce742b1bec3c977387967bc29f2050bff3af929e..b92e9d9f8ce734e818fd2a64700abe6d4a78f0c5 100644
--- a/components/precache/core/precache_session_table.h
+++ b/components/precache/core/precache_session_table.h
@@ -24,13 +24,18 @@ class Connection;
namespace precache {
class PrecacheUnfinishedWork;
+class PrecacheQuota;
sclittle 2016/09/14 17:59:18 Remove this forward include, and add an #include f
Raj 2016/09/14 20:01:51 Done.
// Denotes the type of session information being stored.
enum SessionDataType {
sclittle 2016/09/14 17:59:17 nit: Could you change this to be an enum class? Ri
Raj 2016/09/14 20:01:51 Done.
// Unfinished work to do sometime later.
UNFINISHED_WORK = 0,
+
// Timestamp of the last precache.
LAST_PRECACHE_TIMESTAMP = 1,
+
+ // Remaining quota limits.
+ QUOTA = 2,
};
class PrecacheSessionTable {
@@ -53,6 +58,10 @@ class PrecacheSessionTable {
void DeleteLastPrecacheTimestamp();
+ // Precache quota.
+ void SaveQuota(const PrecacheQuota& quota);
+ PrecacheQuota GetQuota();
+
// -- Unfinished work --
// Stores unfinished work.
@@ -68,6 +77,9 @@ class PrecacheSessionTable {
private:
bool CreateTableIfNonExistent();
+ void SetSessionDataType(SessionDataType id, const std::string& data);
+ std::string GetSessionDataType(SessionDataType id);
+
// Non-owned pointer.
sql::Connection* db_;

Powered by Google App Engine
This is Rietveld 408576698