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

Unified Diff: content/browser/appcache/appcache_update_job.h

Issue 2978373002: Move the URLFetcher class used by the AppCacheUpdateJob class into its own file. (Closed)
Patch Set: Move forward declaration for URLFetcher outside the AppCacheUpdateJob class to fix compile failures. Created 3 years, 5 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 | « content/browser/BUILD.gn ('k') | content/browser/appcache/appcache_update_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/appcache_update_job.h
diff --git a/content/browser/appcache/appcache_update_job.h b/content/browser/appcache/appcache_update_job.h
index e11c78e5a5e9abffe45c951f537c997914ab24d8..841c49d2dd217850c03512604511b86e15c1c319 100644
--- a/content/browser/appcache/appcache_update_job.h
+++ b/content/browser/appcache/appcache_update_job.h
@@ -36,6 +36,7 @@ FORWARD_DECLARE_TEST(AppCacheGroupTest, QueueUpdate);
class AppCacheGroupTest;
class AppCacheUpdateJobTest;
class HostNotifier;
+class URLFetcher;
// Application cache Update algorithm and state.
class CONTENT_EXPORT AppCacheUpdateJob
@@ -60,7 +61,7 @@ class CONTENT_EXPORT AppCacheUpdateJob
private:
friend class content::AppCacheGroupTest;
friend class content::AppCacheUpdateJobTest;
- class URLFetcher;
+ friend class URLFetcher;
// Master entries have multiple hosts, for example, the same page is opened
// in different tabs.
@@ -109,64 +110,6 @@ class CONTENT_EXPORT AppCacheUpdateJob
scoped_refptr<AppCacheResponseInfo> existing_response_info;
};
- class URLFetcher : public net::URLRequest::Delegate {
- public:
- enum FetchType {
- MANIFEST_FETCH,
- URL_FETCH,
- MASTER_ENTRY_FETCH,
- MANIFEST_REFETCH,
- };
- URLFetcher(const GURL& url,
- FetchType fetch_type,
- AppCacheUpdateJob* job);
- ~URLFetcher() override;
- void Start();
- FetchType fetch_type() const { return fetch_type_; }
- net::URLRequest* request() const { return request_.get(); }
- const AppCacheEntry& existing_entry() const { return existing_entry_; }
- const std::string& manifest_data() const { return manifest_data_; }
- AppCacheResponseWriter* response_writer() const {
- return response_writer_.get();
- }
- void set_existing_response_headers(net::HttpResponseHeaders* headers) {
- existing_response_headers_ = headers;
- }
- void set_existing_entry(const AppCacheEntry& entry) {
- existing_entry_ = entry;
- }
- ResultType result() const { return result_; }
- int redirect_response_code() const { return redirect_response_code_; }
-
- private:
- // URLRequest::Delegate overrides
- void OnReceivedRedirect(net::URLRequest* request,
- const net::RedirectInfo& redirect_info,
- bool* defer_redirect) override;
- void OnResponseStarted(net::URLRequest* request, int net_error) override;
- void OnReadCompleted(net::URLRequest* request, int bytes_read) override;
-
- void AddConditionalHeaders(const net::HttpResponseHeaders* headers);
- void OnWriteComplete(int result);
- void ReadResponseData();
- bool ConsumeResponseData(int bytes_read);
- void OnResponseCompleted(int net_error);
- bool MaybeRetryRequest();
-
- GURL url_;
- AppCacheUpdateJob* job_;
- FetchType fetch_type_;
- int retry_503_attempts_;
- scoped_refptr<net::IOBuffer> buffer_;
- std::unique_ptr<net::URLRequest> request_;
- AppCacheEntry existing_entry_;
- scoped_refptr<net::HttpResponseHeaders> existing_response_headers_;
- std::string manifest_data_;
- ResultType result_;
- int redirect_response_code_;
- std::unique_ptr<AppCacheResponseWriter> response_writer_;
- }; // class URLFetcher
-
AppCacheResponseWriter* CreateResponseWriter();
// Methods for AppCacheStorage::Delegate.
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/appcache/appcache_update_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698