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

Side by Side Diff: content/public/renderer/resource_fetcher.h

Issue 1858533002: Introduce WebCachePolicy to merge cache policy enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hiroshige review Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_PUBLIC_RENDERER_RESOURCE_FETCHER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_RESOURCE_FETCHER_H_
6 #define CONTENT_PUBLIC_RENDERER_RESOURCE_FETCHER_H_ 6 #define CONTENT_PUBLIC_RENDERER_RESOURCE_FETCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebURLRequest.h" 12 #include "third_party/WebKit/public/platform/WebURLRequest.h"
13 13
14 class GURL; 14 class GURL;
15 15
16 namespace base { 16 namespace base {
17 class TimeDelta; 17 class TimeDelta;
18 } 18 }
19 19
20 namespace blink { 20 namespace blink {
21 class WebFrame; 21 class WebFrame;
22 class WebURLResponse; 22 class WebURLResponse;
23 enum class WebCachePolicy;
23 struct WebURLLoaderOptions; 24 struct WebURLLoaderOptions;
24 } 25 }
25 26
26 namespace content { 27 namespace content {
27 28
28 // Interface to download resources asynchronously. 29 // Interface to download resources asynchronously.
29 class CONTENT_EXPORT ResourceFetcher { 30 class CONTENT_EXPORT ResourceFetcher {
30 public: 31 public:
31 enum LoaderType { 32 enum LoaderType {
32 PLATFORM_LOADER, // uses Platform::createURLLoader 33 PLATFORM_LOADER, // uses Platform::createURLLoader
(...skipping 15 matching lines...) Expand all
48 static ResourceFetcher* Create(const GURL& url); 49 static ResourceFetcher* Create(const GURL& url);
49 50
50 // Set the corresponding parameters of the request. Must be called before 51 // Set the corresponding parameters of the request. Must be called before
51 // Start. By default, requests are GETs with no body and respect the default 52 // Start. By default, requests are GETs with no body and respect the default
52 // cache policy. 53 // cache policy.
53 virtual void SetMethod(const std::string& method) = 0; 54 virtual void SetMethod(const std::string& method) = 0;
54 virtual void SetBody(const std::string& body) = 0; 55 virtual void SetBody(const std::string& body) = 0;
55 virtual void SetHeader(const std::string& header, 56 virtual void SetHeader(const std::string& header,
56 const std::string& value) = 0; 57 const std::string& value) = 0;
57 virtual void SetSkipServiceWorker(bool skip_service_worker) = 0; 58 virtual void SetSkipServiceWorker(bool skip_service_worker) = 0;
58 virtual void SetCachePolicy(blink::WebURLRequest::CachePolicy policy) = 0; 59 virtual void SetCachePolicy(blink::WebCachePolicy policy) = 0;
59 60
60 // Associate the corresponding WebURLLoaderOptions to the loader. Must be 61 // Associate the corresponding WebURLLoaderOptions to the loader. Must be
61 // called before Start. Used if the LoaderType is FRAME_ASSOCIATED_LOADER. 62 // called before Start. Used if the LoaderType is FRAME_ASSOCIATED_LOADER.
62 virtual void SetLoaderOptions(const blink::WebURLLoaderOptions& options) = 0; 63 virtual void SetLoaderOptions(const blink::WebURLLoaderOptions& options) = 0;
63 64
64 // Starts the request using the specified frame. Calls |callback| when 65 // Starts the request using the specified frame. Calls |callback| when
65 // done. 66 // done.
66 virtual void Start(blink::WebFrame* frame, 67 virtual void Start(blink::WebFrame* frame,
67 blink::WebURLRequest::RequestContext request_context, 68 blink::WebURLRequest::RequestContext request_context,
68 blink::WebURLRequest::FrameType frame_type, 69 blink::WebURLRequest::FrameType frame_type,
69 LoaderType loader_type, 70 LoaderType loader_type,
70 const Callback& callback) = 0; 71 const Callback& callback) = 0;
71 72
72 // Sets how long to wait for the server to reply. By default, there is no 73 // Sets how long to wait for the server to reply. By default, there is no
73 // timeout. Must be called after a request is started. 74 // timeout. Must be called after a request is started.
74 virtual void SetTimeout(const base::TimeDelta& timeout) = 0; 75 virtual void SetTimeout(const base::TimeDelta& timeout) = 0;
75 76
76 // Manually cancel the request. 77 // Manually cancel the request.
77 virtual void Cancel() = 0; 78 virtual void Cancel() = 0;
78 }; 79 };
79 80
80 } // namespace content 81 } // namespace content
81 82
82 #endif // CONTENT_PUBLIC_RENDERER_RESOURCE_FETCHER_H_ 83 #endif // CONTENT_PUBLIC_RENDERER_RESOURCE_FETCHER_H_
OLDNEW
« no previous file with comments | « content/child/web_url_request_util.cc ('k') | content/renderer/fetchers/multi_resolution_image_resource_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698