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

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

Issue 2335913002: Add daily quota for precache (Closed)
Patch Set: rebased 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/precache/core/precache_database.cc ('k') | components/precache/core/precache_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/core/precache_fetcher.h
diff --git a/components/precache/core/precache_fetcher.h b/components/precache/core/precache_fetcher.h
index 3c6f9e6e612ebf6e7c982147b0fc36ea722d6aa4..adfdb8f022a4bf1c48e1a51e031243d9d4c46e39 100644
--- a/components/precache/core/precache_fetcher.h
+++ b/components/precache/core/precache_fetcher.h
@@ -19,6 +19,7 @@
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "components/precache/core/fetcher_pool.h"
+#include "components/precache/core/proto/quota.pb.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h"
@@ -154,6 +155,7 @@ class PrecacheFetcher : public base::SupportsWeakPtr<PrecacheFetcher> {
FRIEND_TEST_ALL_PREFIXES(PrecacheFetcherTest, FetcherPoolMaxLimitReached);
FRIEND_TEST_ALL_PREFIXES(PrecacheFetcherTest,
CancelPrecachingAfterAllManifestFetch);
+ FRIEND_TEST_ALL_PREFIXES(PrecacheFetcherTest, DailyQuota);
// Notifies the precache delete that precaching is done, and report
// completion statistics.
@@ -192,6 +194,9 @@ class PrecacheFetcher : public base::SupportsWeakPtr<PrecacheFetcher> {
// Callback invoked when the manifest info for all the top hosts is retrieved.
void OnManifestInfoRetrieved(std::deque<ManifestHostInfo> manifests_info);
+ // Callback invoked when the quota is retrieved.
+ void OnQuotaInfoRetrieved(const PrecacheQuota& quota);
+
// The request context used when fetching URLs.
const scoped_refptr<net::URLRequestContextGetter> request_context_;
@@ -217,6 +222,9 @@ class PrecacheFetcher : public base::SupportsWeakPtr<PrecacheFetcher> {
std::unique_ptr<PrecacheUnfinishedWork> unfinished_work_;
+ // Daily quota.
+ PrecacheQuota quota_;
+
// The fieldtrial experiment ID.
uint32_t experiment_id_;
« no previous file with comments | « components/precache/core/precache_database.cc ('k') | components/precache/core/precache_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698