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

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

Issue 2848493007: Reduce/Remove URLRequest dependencies from AppCacheRequestHandler (Closed)
Patch Set: Address comments Created 3 years, 8 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
Index: content/browser/appcache/appcache_url_loader.h
diff --git a/content/browser/appcache/appcache_url_loader.h b/content/browser/appcache/appcache_url_loader.h
new file mode 100644
index 0000000000000000000000000000000000000000..39d6e7064da706e34300f2cb54a1e40e12c9b9b3
--- /dev/null
+++ b/content/browser/appcache/appcache_url_loader.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_H_
+#define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_H_
+
+#include "content/browser/appcache/appcache_request.h"
+#include "content/common/resource_request.h"
+
+namespace content {
+
+// AppCacheRequest wrapper for the ResourceRequest class for users of
+// URLLoader.
+class CONTENT_EXPORT AppCacheURLLoader : public AppCacheRequest {
michaeln 2017/05/03 02:32:12 Sorry for the naming nit, but this isn't the 'load
jam 2017/05/03 03:54:45 My suggestion was because one subclass is implemen
+ public:
+ // Factory function to create an instance of the AppCacheResourceRequest
+ // class.
+ static AppCacheURLLoader* Create(const ResourceRequest& request);
+
+ // AppCacheRequest overrides.
+ // TODO(ananta)
+ // Add support to the GetURL() call to return the updated URL while following
+ // a chain of redirects.
+ const GURL& GetURL() const override;
+ const std::string& GetMethod() const override;
+ const GURL& GetFirstPartyForCookies() const override;
+ const GURL GetReferrer() const override;
+ // TODO(ananta)
+ // ResourceRequest only identifies the request unlike URLRequest which
+ // contains response information as well. We need the following methods to
+ // work for AppCache. Look into this.
+ bool IsSuccess() const override;
+ bool IsCancelled() const override;
+ bool IsError() const override;
+ int GetResponseCode() const override;
+ std::string GetResponseHeaderByName(const std::string& name) const override;
+
+ ResourceRequest* GetResourceRequest() override;
+
+ protected:
+ explicit AppCacheURLLoader(const ResourceRequest& request);
+ ~AppCacheURLLoader() override;
+
+ private:
+ ResourceRequest request_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoader);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_H_
« no previous file with comments | « content/browser/appcache/appcache_request_handler_unittest.cc ('k') | content/browser/appcache/appcache_url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698