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

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

Issue 2586813004: Report downloaded resources at most once (Closed)
Patch Set: Fix race condition in PrecacheFetcherTest due to MaybePost Created 4 years 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_database.h
diff --git a/components/precache/core/precache_database.h b/components/precache/core/precache_database.h
index e610ac48c32c9935f2370443ff63f39c35aac9d2..156ea329c6e3bf2f21195768109ae0389349f898 100644
--- a/components/precache/core/precache_database.h
+++ b/components/precache/core/precache_database.h
@@ -92,11 +92,11 @@ class PrecacheDatabase {
// Returns the referrer host entry for the |referrer_host|.
PrecacheReferrerHostEntry GetReferrerHost(const std::string& referrer_host);
- // Populates the list of used and unused resources for referrer host with id
- // |referrer_host_id|.
+ // Populates the list of used and downloaded resources for referrer host with
+ // id |referrer_host_id|. It will also clear the reported downloaded_urls.
void GetURLListForReferrerHost(int64_t referrer_host_id,
std::vector<GURL>* used_urls,
- std::vector<GURL>* unused_urls);
+ std::vector<GURL>* downloaded_urls);
// Updates the |manifest_id| and |fetch_time| for the referrer host
// |hostname|, and deletes the precached subresource URLs for this top host.
@@ -123,6 +123,7 @@ class PrecacheDatabase {
private:
friend class PrecacheDatabaseTest;
+ friend class PrecacheFetcherTest;
bool IsDatabaseAccessible() const;
@@ -146,6 +147,7 @@ class PrecacheDatabase {
void RecordURLPrefetchInternal(const GURL& url,
const std::string& referrer_host,
bool is_precached,
+ bool was_cached,
const base::Time& fetch_time);
void UpdatePrecacheReferrerHostInternal(const std::string& hostname,
« no previous file with comments | « no previous file | components/precache/core/precache_database.cc » ('j') | components/precache/core/precache_database_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698