Chromium Code Reviews| 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..f2cd52a3ab43364828eb8baa56e4dc995faa9398 100644 |
| --- a/components/precache/core/precache_session_table.h |
| +++ b/components/precache/core/precache_session_table.h |
| @@ -5,17 +5,11 @@ |
| #ifndef COMPONENTS_PRECACHE_CORE_PRECACHE_SESSION_TABLE_H_ |
| #define COMPONENTS_PRECACHE_CORE_PRECACHE_SESSION_TABLE_H_ |
| -#include <list> |
| -#include <map> |
| #include <memory> |
| #include "base/macros.h" |
| #include "base/time/time.h" |
| -#include "url/gurl.h" |
| - |
| -namespace base { |
| -class TimeTicks; |
| -} |
| +#include "components/precache/core/proto/quota.pb.h" |
| namespace sql { |
| class Connection; |
| @@ -24,13 +18,18 @@ class Connection; |
| namespace precache { |
| class PrecacheUnfinishedWork; |
| +class PrecacheQuota; |
|
sclittle
2016/09/21 20:07:24
nit: remove this forward declaration, since you're
Raj
2016/09/22 18:34:33
Done.
|
| // Denotes the type of session information being stored. |
| -enum SessionDataType { |
| +enum class SessionDataType { |
| // 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 +52,10 @@ class PrecacheSessionTable { |
| void DeleteLastPrecacheTimestamp(); |
| + // Precache quota. |
| + void SaveQuota(const PrecacheQuota& quota); |
| + PrecacheQuota GetQuota(); |
| + |
| // -- Unfinished work -- |
| // Stores unfinished work. |
| @@ -68,6 +71,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_; |