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

Side by Side Diff: content/browser/appcache/appcache_url_loader_request.h

Issue 2874663004: Provide skeleton functionality for AppCache handling in the network service. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_REQUEST_H_ 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_REQUEST_H_
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_REQUEST_H_ 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_REQUEST_H_
7 7
8 #include "content/browser/appcache/appcache_request.h" 8 #include "content/browser/appcache/appcache_request.h"
9 #include "content/common/resource_request.h" 9 #include "content/common/resource_request.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 // AppCacheRequest wrapper for the ResourceRequest class for users of 13 // AppCacheRequest wrapper for the ResourceRequest class for users of
14 // URLLoader. 14 // URLLoader.
15 class CONTENT_EXPORT AppCacheURLLoaderRequest : public AppCacheRequest { 15 class CONTENT_EXPORT AppCacheURLLoaderRequest : public AppCacheRequest {
16 public: 16 public:
17 // Factory function to create an instance of the AppCacheResourceRequest 17 // Factory function to create an instance of the AppCacheResourceRequest
18 // class. 18 // class.
19 static AppCacheURLLoaderRequest* Create(const ResourceRequest& request); 19 static std::unique_ptr<AppCacheURLLoaderRequest> Create(
20 std::unique_ptr<ResourceRequest> request);
21
22 ~AppCacheURLLoaderRequest() override;
20 23
21 // AppCacheRequest overrides. 24 // AppCacheRequest overrides.
22 // TODO(ananta) 25 // TODO(ananta)
23 // Add support to the GetURL() call to return the updated URL while following 26 // Add support to the GetURL() call to return the updated URL while following
24 // a chain of redirects. 27 // a chain of redirects.
25 const GURL& GetURL() const override; 28 const GURL& GetURL() const override;
26 const std::string& GetMethod() const override; 29 const std::string& GetMethod() const override;
27 const GURL& GetFirstPartyForCookies() const override; 30 const GURL& GetFirstPartyForCookies() const override;
28 const GURL GetReferrer() const override; 31 const GURL GetReferrer() const override;
29 // TODO(ananta) 32 // TODO(ananta)
30 // ResourceRequest only identifies the request unlike URLRequest which 33 // ResourceRequest only identifies the request unlike URLRequest which
31 // contains response information as well. We need the following methods to 34 // contains response information as well. We need the following methods to
32 // work for AppCache. Look into this. 35 // work for AppCache. Look into this.
33 bool IsSuccess() const override; 36 bool IsSuccess() const override;
34 bool IsCancelled() const override; 37 bool IsCancelled() const override;
35 bool IsError() const override; 38 bool IsError() const override;
36 int GetResponseCode() const override; 39 int GetResponseCode() const override;
37 std::string GetResponseHeaderByName(const std::string& name) const override; 40 std::string GetResponseHeaderByName(const std::string& name) const override;
38 41
39 ResourceRequest* GetResourceRequest() override; 42 ResourceRequest* GetResourceRequest() override;
40 43
41 protected: 44 protected:
42 explicit AppCacheURLLoaderRequest(const ResourceRequest& request); 45 explicit AppCacheURLLoaderRequest(std::unique_ptr<ResourceRequest> request);
43 ~AppCacheURLLoaderRequest() override;
44 46
45 private: 47 private:
46 ResourceRequest request_; 48 std::unique_ptr<ResourceRequest> request_;
47 49
48 DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderRequest); 50 DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderRequest);
49 }; 51 };
50 52
51 } // namespace content 53 } // namespace content
52 54
53 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_REQUEST_H_ 55 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698