Chromium Code Reviews| Index: components/precache/core/precache_url_table.h |
| diff --git a/components/precache/core/precache_url_table.h b/components/precache/core/precache_url_table.h |
| index 2fcdc1461096e3bea41a724513a2b69d6e72bfc9..0ac230994fbc2158c0c568f3fbab00429263e870 100644 |
| --- a/components/precache/core/precache_url_table.h |
| +++ b/components/precache/core/precache_url_table.h |
| @@ -5,6 +5,7 @@ |
| #ifndef COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ |
| #define COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ |
| +#include <deque> |
| #include <map> |
| #include "base/macros.h" |
| @@ -33,12 +34,28 @@ class PrecacheURLTable { |
| // Init must be called before any other methods. |
| bool Init(sql::Connection* db); |
| - // Adds a precached URL to the table, using the current time as the |
| - // precache timestamp. Replaces the row if one already exists. |
| - void AddURL(const GURL& url, const base::Time& precache_time); |
| + // Adds an URL to the table, |referrer_host_id| is the id of the referrer host |
| + // in PrecacheReferrerHostTable, |is_precached| indicates if the URL is |
| + // precached, |time| is the timestamp. Replaces the row if one already exists. |
| + void AddURL(const GURL& url, |
| + int64_t referrer_host_id, |
| + bool is_precached, |
| + const base::Time& precache_time); |
| - // Returns true if this URL exists in the table. |
| - bool HasURL(const GURL& url); |
| + // Returns true if the url is precached. |
| + bool IsURLPrecached(const GURL& url); |
| + |
| + // Returns true if the url is precached, and was not used before. |
| + bool IsURLPrecachedAndUnused(const GURL& url); |
| + |
| + // Sets the precached URL as used. |
| + void SetPrecachedURLAsUsed(const GURL& url); |
| + |
| + // Populates the used and unused resource URLs for the referrer host with id |
| + // |referrer_host_id|. |
| + void GetURLListForReferrerHost(int64_t referrer_host_id, |
|
bengr
2016/08/11 18:49:15
#include <stdint.h>
Raj
2016/08/12 19:04:21
Done.
|
| + std::deque<GURL>& used_urls, |
|
sclittle
2016/08/11 22:52:36
Don't pass by non-const ref, just pass a pointer i
Raj
2016/08/12 19:04:21
Done.
|
| + std::deque<GURL>& unused_urls); |
|
sclittle
2016/08/11 22:52:36
Can these just be std::vector instead of std::dequ
Raj
2016/08/12 19:04:21
Done.
|
| // Deletes the row from the table that has the given URL, if it exists. |
| void DeleteURL(const GURL& url); |