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 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
16 #include "content/browser/service_worker/service_worker_context_wrapper.h" | |
16 #include "content/common/resource_request_body_impl.h" | 17 #include "content/common/resource_request_body_impl.h" |
17 #include "content/public/browser/navigation_ui_data.h" | 18 #include "content/public/browser/navigation_ui_data.h" |
18 #include "content/public/browser/resource_request_info.h" | 19 #include "content/public/browser/resource_request_info.h" |
19 #include "content/public/common/referrer.h" | 20 #include "content/public/common/referrer.h" |
20 #include "content/public/common/resource_type.h" | 21 #include "content/public/common/resource_type.h" |
21 #include "net/base/load_states.h" | 22 #include "net/base/load_states.h" |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 class CrossSiteResourceHandler; | 25 class CrossSiteResourceHandler; |
25 class DetachableResourceHandler; | 26 class DetachableResourceHandler; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 } | 199 } |
199 void set_initiated_in_secure_context_for_testing(bool secure) { | 200 void set_initiated_in_secure_context_for_testing(bool secure) { |
200 initiated_in_secure_context_ = secure; | 201 initiated_in_secure_context_ = secure; |
201 } | 202 } |
202 | 203 |
203 void set_navigation_ui_data( | 204 void set_navigation_ui_data( |
204 std::unique_ptr<NavigationUIData> navigation_ui_data) { | 205 std::unique_ptr<NavigationUIData> navigation_ui_data) { |
205 navigation_ui_data_ = std::move(navigation_ui_data); | 206 navigation_ui_data_ = std::move(navigation_ui_data); |
206 } | 207 } |
207 | 208 |
209 // PlzNavigate: used in navigations to store the ServiceWorkerContext, since | |
210 // the ResourceMessageFilter will be null in this case. All other requests | |
211 // should access the ServiceWorkerContext through the ResourceMessageFilter. | |
212 void set_service_worker_context( | |
213 ServiceWorkerContextWrapper* service_worker_context) { | |
falken
2016/10/07 03:49:32
nit: in modern Chromium style this should be a sco
clamy
2016/10/07 10:01:52
Done.
| |
214 service_worker_context_ = service_worker_context; | |
215 } | |
216 ServiceWorkerContextWrapper* service_worker_context() const { | |
217 return service_worker_context_.get(); | |
218 } | |
219 | |
208 private: | 220 private: |
209 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 221 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
210 DeletedFilterDetached); | 222 DeletedFilterDetached); |
211 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 223 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
212 DeletedFilterDetachedRedirect); | 224 DeletedFilterDetachedRedirect); |
213 // Non-owning, may be NULL. | 225 // Non-owning, may be NULL. |
214 CrossSiteResourceHandler* cross_site_handler_; | 226 CrossSiteResourceHandler* cross_site_handler_; |
215 DetachableResourceHandler* detachable_handler_; | 227 DetachableResourceHandler* detachable_handler_; |
216 | 228 |
217 int process_type_; | 229 int process_type_; |
(...skipping 24 matching lines...) Expand all Loading... | |
242 // The filter might be deleted without deleting this object if the process | 254 // The filter might be deleted without deleting this object if the process |
243 // exits during a transfer. | 255 // exits during a transfer. |
244 base::WeakPtr<ResourceMessageFilter> filter_; | 256 base::WeakPtr<ResourceMessageFilter> filter_; |
245 bool report_raw_headers_; | 257 bool report_raw_headers_; |
246 bool is_async_; | 258 bool is_async_; |
247 bool is_using_lofi_; | 259 bool is_using_lofi_; |
248 const std::string original_headers_; | 260 const std::string original_headers_; |
249 scoped_refptr<ResourceRequestBodyImpl> body_; | 261 scoped_refptr<ResourceRequestBodyImpl> body_; |
250 bool initiated_in_secure_context_; | 262 bool initiated_in_secure_context_; |
251 std::unique_ptr<NavigationUIData> navigation_ui_data_; | 263 std::unique_ptr<NavigationUIData> navigation_ui_data_; |
264 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | |
252 | 265 |
253 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 266 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
254 }; | 267 }; |
255 | 268 |
256 } // namespace content | 269 } // namespace content |
257 | 270 |
258 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 271 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
OLD | NEW |