OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/fetchers/resource_fetcher_impl.h" | 5 #include "content/renderer/fetchers/resource_fetcher_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "third_party/WebKit/public/platform/Platform.h" | 10 #include "third_party/WebKit/public/platform/Platform.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 void ResourceFetcherImpl::SetSkipServiceWorker(bool skip_service_worker) { | 72 void ResourceFetcherImpl::SetSkipServiceWorker(bool skip_service_worker) { |
73 DCHECK(!request_.isNull()); | 73 DCHECK(!request_.isNull()); |
74 DCHECK(!loader_); | 74 DCHECK(!loader_); |
75 | 75 |
76 request_.setSkipServiceWorker(skip_service_worker); | 76 request_.setSkipServiceWorker(skip_service_worker); |
77 } | 77 } |
78 | 78 |
| 79 void ResourceFetcherImpl::SetCachePolicy( |
| 80 blink::WebURLRequest::CachePolicy policy) { |
| 81 DCHECK(!request_.isNull()); |
| 82 DCHECK(!loader_); |
| 83 |
| 84 request_.setCachePolicy(policy); |
| 85 } |
| 86 |
79 void ResourceFetcherImpl::SetLoaderOptions( | 87 void ResourceFetcherImpl::SetLoaderOptions( |
80 const blink::WebURLLoaderOptions& options) { | 88 const blink::WebURLLoaderOptions& options) { |
81 DCHECK(!request_.isNull()); | 89 DCHECK(!request_.isNull()); |
82 DCHECK(!loader_); | 90 DCHECK(!loader_); |
83 | 91 |
84 options_ = options; | 92 options_ = options; |
85 } | 93 } |
86 | 94 |
87 void ResourceFetcherImpl::Start( | 95 void ResourceFetcherImpl::Start( |
88 blink::WebFrame* frame, | 96 blink::WebFrame* frame, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 callback.Run(status() == LOAD_FAILED ? blink::WebURLResponse() : response(), | 144 callback.Run(status() == LOAD_FAILED ? blink::WebURLResponse() : response(), |
137 status() == LOAD_FAILED ? std::string() : data()); | 145 status() == LOAD_FAILED ? std::string() : data()); |
138 } | 146 } |
139 | 147 |
140 void ResourceFetcherImpl::Cancel() { | 148 void ResourceFetcherImpl::Cancel() { |
141 loader_->cancel(); | 149 loader_->cancel(); |
142 WebURLLoaderClientImpl::Cancel(); | 150 WebURLLoaderClientImpl::Cancel(); |
143 } | 151 } |
144 | 152 |
145 } // namespace content | 153 } // namespace content |
OLD | NEW |