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

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

Issue 2614403003: Add revalidation_only option to precache config. (Closed)
Patch Set: Add Fetcher constructor parameter comments. Created 3 years, 11 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 | « no previous file | 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 83dd4feebfd72b1d88d6308024cfe6b7f0e8d50d..87d1c4aa2370d3d11f14df24ce5e79bf532ac0f6 100644
--- a/components/precache/core/precache_fetcher.h
+++ b/components/precache/core/precache_fetcher.h
@@ -292,14 +292,25 @@ class PrecacheFetcher : public base::SupportsWeakPtr<PrecacheFetcher> {
// network_url_fetcher() will return nullptr.
class PrecacheFetcher::Fetcher : public net::URLFetcherDelegate {
public:
- // Construct a new Fetcher. This will create and start a new URLFetcher for
- // the specified URL using the specified request context.
+ // Construct a new Fetcher. This will create and start a new URLFetcher
+ // immediately. Parameters:
+ // request_context: The request context to pass to the URLFetcher.
+ // url: The URL to fetch.
+ // referrer: The hostname of the manifest requesting this resource. Empty
+ // for config fetches.
+ // callback: Called when the fetch is finished or cancelled.
+ // is_resource_request: If true, the URL may be refreshed using
+ // LOAD_VALIDATE_CACHE.
+ // max_bytes: The number of bytes to download before cancelling.
+ // revalidation_only: If true, the URL is fetched only if it has an existing
+ // cache entry with conditional headers.
Fetcher(net::URLRequestContextGetter* request_context,
const GURL& url,
const std::string& referrer,
const base::Callback<void(const Fetcher&)>& callback,
bool is_resource_request,
- size_t max_bytes);
+ size_t max_bytes,
+ bool revalidation_only);
~Fetcher() override;
void OnURLFetchDownloadProgress(const net::URLFetcher* source,
int64_t current,
@@ -322,12 +333,14 @@ class PrecacheFetcher::Fetcher : public net::URLFetcherDelegate {
void LoadFromCache();
void LoadFromNetwork();
+ // The arguments to this Fetcher's constructor.
net::URLRequestContextGetter* const request_context_;
const GURL url_;
const std::string referrer_;
const base::Callback<void(const Fetcher&)> callback_;
const bool is_resource_request_;
const size_t max_bytes_;
+ const bool revalidation_only_;
FetchStage fetch_stage_;
// The cache_url_fetcher_ is kept alive until Fetcher destruction for testing.
« no previous file with comments | « no previous file | components/precache/core/precache_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698