Chromium Code Reviews| Index: components/precache/content/precache_manager.h |
| diff --git a/components/precache/content/precache_manager.h b/components/precache/content/precache_manager.h |
| index 614ea0bd0b663d987d14371a516b984b491df4dd..ab4b695bfe345410b47812d99e65d372b936d538 100644 |
| --- a/components/precache/content/precache_manager.h |
| +++ b/components/precache/content/precache_manager.h |
| @@ -96,18 +96,21 @@ class PrecacheManager : public KeyedService, |
| // Returns true if precaching is currently in progress, or false otherwise. |
| bool IsPrecaching() const; |
| - // Update precache-related metrics in response to a URL being fetched. |
| - void RecordStatsForFetch(const GURL& url, |
| - const GURL& referrer, |
| - const base::TimeDelta& latency, |
| - const base::Time& fetch_time, |
| - int64_t size, |
| - bool was_cached); |
| - |
| // Posts a task to the DB thread to delete all history entries from the |
| // database. Does not wait for completion of this task. |
| void ClearHistory(); |
| + // Update precache about an URL being fetched. Metrics related to precache are |
| + // updated and any ongoing precache will be cancelled if this is an user |
| + // initiated request. Should be called on UI thread. |
| + void UpdatePrecacheMetricsAndState(const GURL& url, |
| + const GURL& referrer, |
| + base::TimeDelta latency, |
|
bengr
2016/06/20 20:21:14
Forward declare. Also shouldn't this be a const ba
Raj
2016/06/30 06:03:08
Done.
|
| + const base::Time& fetch_time, |
| + int64_t size, |
| + bool was_cached, |
| + bool is_user_traffic); |
| + |
| private: |
| enum class AllowedType { |
| ALLOWED, |
| @@ -138,6 +141,14 @@ class PrecacheManager : public KeyedService, |
| // Returns true if precaching is allowed for the browser context. |
| AllowedType PrecachingAllowed() const; |
| + // Update precache-related metrics in response to a URL being fetched. |
| + void RecordStatsForFetch(const GURL& url, |
| + const GURL& referrer, |
| + const base::TimeDelta& latency, |
| + const base::Time& fetch_time, |
| + int64_t size, |
| + bool was_cached); |
| + |
| // Update precache-related metrics in response to a URL being fetched. Called |
| // by RecordStatsForFetch() by way of an asynchronous HistoryService callback. |
| void RecordStatsForFetchInternal(const GURL& url, |