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

Side by Side Diff: components/precache/content/precache_manager.h

Issue 2229983002: Send the list of used and unused resources for precache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits 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 unified diff | Download patch
« no previous file with comments | « components/precache.gypi ('k') | components/precache/content/precache_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ 5 #ifndef COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_
6 #define COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ 6 #define COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // initiated request. Should be called on UI thread. 110 // initiated request. Should be called on UI thread.
111 void UpdatePrecacheMetricsAndState(const GURL& url, 111 void UpdatePrecacheMetricsAndState(const GURL& url,
112 const GURL& referrer, 112 const GURL& referrer,
113 const base::TimeDelta& latency, 113 const base::TimeDelta& latency,
114 const base::Time& fetch_time, 114 const base::Time& fetch_time,
115 const net::HttpResponseInfo& info, 115 const net::HttpResponseInfo& info,
116 int64_t size, 116 int64_t size,
117 bool is_user_traffic); 117 bool is_user_traffic);
118 118
119 private: 119 private:
120 friend class PrecacheManagerTest;
120 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, DeleteExpiredPrecacheHistory); 121 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, DeleteExpiredPrecacheHistory);
121 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, 122 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest,
122 RecordStatsForFetchDuringPrecaching); 123 RecordStatsForFetchDuringPrecaching);
123 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchHTTP); 124 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchHTTP);
124 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchHTTPS); 125 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchHTTPS);
125 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchInTopHosts); 126 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchInTopHosts);
126 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, 127 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest,
127 RecordStatsForFetchWithEmptyURL); 128 RecordStatsForFetchWithEmptyURL);
128 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchWithNonHTTP); 129 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, RecordStatsForFetchWithNonHTTP);
129 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest, 130 FRIEND_TEST_ALL_PREFIXES(PrecacheManagerTest,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void RecordStatsForFetch(const GURL& url, 163 void RecordStatsForFetch(const GURL& url,
163 const GURL& referrer, 164 const GURL& referrer,
164 const base::TimeDelta& latency, 165 const base::TimeDelta& latency,
165 const base::Time& fetch_time, 166 const base::Time& fetch_time,
166 const net::HttpResponseInfo& info, 167 const net::HttpResponseInfo& info,
167 int64_t size); 168 int64_t size);
168 169
169 // Update precache-related metrics in response to a URL being fetched. Called 170 // Update precache-related metrics in response to a URL being fetched. Called
170 // by RecordStatsForFetch() by way of an asynchronous HistoryService callback. 171 // by RecordStatsForFetch() by way of an asynchronous HistoryService callback.
171 void RecordStatsForFetchInternal(const GURL& url, 172 void RecordStatsForFetchInternal(const GURL& url,
173 const std::string& referrer_host,
172 const base::TimeDelta& latency, 174 const base::TimeDelta& latency,
173 const base::Time& fetch_time, 175 const base::Time& fetch_time,
174 const net::HttpResponseInfo& info, 176 const net::HttpResponseInfo& info,
175 int64_t size, 177 int64_t size,
176 int host_rank); 178 int host_rank);
177 179
178 // The browser context that owns this PrecacheManager. 180 // The browser context that owns this PrecacheManager.
179 content::BrowserContext* const browser_context_; 181 content::BrowserContext* const browser_context_;
180 182
181 // The sync service corresponding to the browser context. Used to determine 183 // The sync service corresponding to the browser context. Used to determine
(...skipping 21 matching lines...) Expand all
203 205
204 // Work that hasn't yet finished. 206 // Work that hasn't yet finished.
205 std::unique_ptr<PrecacheUnfinishedWork> unfinished_work_; 207 std::unique_ptr<PrecacheUnfinishedWork> unfinished_work_;
206 208
207 DISALLOW_COPY_AND_ASSIGN(PrecacheManager); 209 DISALLOW_COPY_AND_ASSIGN(PrecacheManager);
208 }; 210 };
209 211
210 } // namespace precache 212 } // namespace precache
211 213
212 #endif // COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_ 214 #endif // COMPONENTS_PRECACHE_CONTENT_PRECACHE_MANAGER_H_
OLDNEW
« no previous file with comments | « components/precache.gypi ('k') | components/precache/content/precache_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698