OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_FETCHERS_RESOURCE_FETCHER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_FETCHERS_RESOURCE_FETCHER_IMPL_H_ |
6 #define CONTENT_RENDERER_FETCHERS_RESOURCE_FETCHER_IMPL_H_ | 6 #define CONTENT_RENDERER_FETCHERS_RESOURCE_FETCHER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "content/public/renderer/resource_fetcher.h" | 15 #include "content/public/renderer/resource_fetcher.h" |
16 #include "content/renderer/fetchers/web_url_loader_client_impl.h" | 16 #include "content/renderer/fetchers/web_url_loader_client_impl.h" |
17 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 17 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
18 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 18 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
19 #include "third_party/WebKit/public/web/WebURLLoaderOptions.h" | 19 #include "third_party/WebKit/public/web/WebURLLoaderOptions.h" |
20 | 20 |
21 class GURL; | 21 class GURL; |
22 | 22 |
23 namespace blink { | 23 namespace blink { |
24 class WebFrame; | 24 class WebFrame; |
25 class WebURLLoader; | 25 class WebURLLoader; |
| 26 enum class WebCachePolicy; |
26 } | 27 } |
27 | 28 |
28 namespace content { | 29 namespace content { |
29 | 30 |
30 class ResourceFetcherImpl : public ResourceFetcher, | 31 class ResourceFetcherImpl : public ResourceFetcher, |
31 public WebURLLoaderClientImpl { | 32 public WebURLLoaderClientImpl { |
32 public: | 33 public: |
33 // ResourceFetcher implementation: | 34 // ResourceFetcher implementation: |
34 void SetMethod(const std::string& method) override; | 35 void SetMethod(const std::string& method) override; |
35 void SetBody(const std::string& body) override; | 36 void SetBody(const std::string& body) override; |
36 void SetHeader(const std::string& header, const std::string& value) override; | 37 void SetHeader(const std::string& header, const std::string& value) override; |
37 void SetSkipServiceWorker(bool skip_service_worker) override; | 38 void SetSkipServiceWorker(bool skip_service_worker) override; |
38 void SetCachePolicy(blink::WebURLRequest::CachePolicy policy) override; | 39 void SetCachePolicy(blink::WebCachePolicy policy) override; |
39 void SetLoaderOptions(const blink::WebURLLoaderOptions& options) override; | 40 void SetLoaderOptions(const blink::WebURLLoaderOptions& options) override; |
40 void Start(blink::WebFrame* frame, | 41 void Start(blink::WebFrame* frame, |
41 blink::WebURLRequest::RequestContext request_context, | 42 blink::WebURLRequest::RequestContext request_context, |
42 blink::WebURLRequest::FrameType frame_type, | 43 blink::WebURLRequest::FrameType frame_type, |
43 LoaderType loader_type, | 44 LoaderType loader_type, |
44 const Callback& callback) override; | 45 const Callback& callback) override; |
45 void SetTimeout(const base::TimeDelta& timeout) override; | 46 void SetTimeout(const base::TimeDelta& timeout) override; |
46 | 47 |
47 private: | 48 private: |
48 friend class ResourceFetcher; | 49 friend class ResourceFetcher; |
(...skipping 23 matching lines...) Expand all Loading... |
72 | 73 |
73 // Limit how long to wait for the server. | 74 // Limit how long to wait for the server. |
74 base::OneShotTimer timeout_timer_; | 75 base::OneShotTimer timeout_timer_; |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(ResourceFetcherImpl); | 77 DISALLOW_COPY_AND_ASSIGN(ResourceFetcherImpl); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace content | 80 } // namespace content |
80 | 81 |
81 #endif // CONTENT_RENDERER_FETCHERS_RESOURCE_FETCHER_IMPL_H_ | 82 #endif // CONTENT_RENDERER_FETCHERS_RESOURCE_FETCHER_IMPL_H_ |
OLD | NEW |