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/public/browser/resource_request_info.h" | 16 #include "content/public/browser/resource_request_info.h" |
17 #include "content/public/common/referrer.h" | 17 #include "content/public/common/referrer.h" |
18 #include "content/public/common/resource_type.h" | 18 #include "content/public/common/resource_type.h" |
| 19 #include "mojo/public/cpp/system/data_pipe.h" |
19 #include "net/base/load_states.h" | 20 #include "net/base/load_states.h" |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 class CrossSiteResourceHandler; | 23 class CrossSiteResourceHandler; |
23 class DetachableResourceHandler; | 24 class DetachableResourceHandler; |
24 class ResourceContext; | 25 class ResourceContext; |
25 class ResourceMessageFilter; | 26 class ResourceMessageFilter; |
26 struct GlobalRequestID; | 27 struct GlobalRequestID; |
27 struct GlobalRoutingID; | 28 struct GlobalRoutingID; |
28 | 29 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 bool is_load_timing_enabled() const { return enable_load_timing_; } | 178 bool is_load_timing_enabled() const { return enable_load_timing_; } |
178 | 179 |
179 bool is_upload_progress_enabled() const { return enable_upload_progress_; } | 180 bool is_upload_progress_enabled() const { return enable_upload_progress_; } |
180 | 181 |
181 bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; } | 182 bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; } |
182 void set_do_not_prompt_for_login(bool do_not_prompt) { | 183 void set_do_not_prompt_for_login(bool do_not_prompt) { |
183 do_not_prompt_for_login_ = do_not_prompt; | 184 do_not_prompt_for_login_ = do_not_prompt; |
184 } | 185 } |
185 const std::string& original_headers() const { return original_headers_; } | 186 const std::string& original_headers() const { return original_headers_; } |
186 | 187 |
| 188 void InstallBodyReader(mojo::ScopedDataPipeConsumerHandle response_body) { |
| 189 response_body_ = std::move(response_body); |
| 190 } |
| 191 mojo::ScopedDataPipeConsumerHandle TakeBodyReader() { |
| 192 return std::move(response_body_); |
| 193 } |
| 194 |
187 private: | 195 private: |
188 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 196 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
189 DeletedFilterDetached); | 197 DeletedFilterDetached); |
190 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 198 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
191 DeletedFilterDetachedRedirect); | 199 DeletedFilterDetachedRedirect); |
192 // Non-owning, may be NULL. | 200 // Non-owning, may be NULL. |
193 CrossSiteResourceHandler* cross_site_handler_; | 201 CrossSiteResourceHandler* cross_site_handler_; |
194 DetachableResourceHandler* detachable_handler_; | 202 DetachableResourceHandler* detachable_handler_; |
195 | 203 |
196 int process_type_; | 204 int process_type_; |
(...skipping 21 matching lines...) Expand all Loading... |
218 blink::WebReferrerPolicy referrer_policy_; | 226 blink::WebReferrerPolicy referrer_policy_; |
219 blink::WebPageVisibilityState visibility_state_; | 227 blink::WebPageVisibilityState visibility_state_; |
220 ResourceContext* context_; | 228 ResourceContext* context_; |
221 // The filter might be deleted without deleting this object if the process | 229 // The filter might be deleted without deleting this object if the process |
222 // exits during a transfer. | 230 // exits during a transfer. |
223 base::WeakPtr<ResourceMessageFilter> filter_; | 231 base::WeakPtr<ResourceMessageFilter> filter_; |
224 bool report_raw_headers_; | 232 bool report_raw_headers_; |
225 bool is_async_; | 233 bool is_async_; |
226 bool is_using_lofi_; | 234 bool is_using_lofi_; |
227 const std::string original_headers_; | 235 const std::string original_headers_; |
| 236 mojo::ScopedDataPipeConsumerHandle response_body_; |
228 | 237 |
229 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 238 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
230 }; | 239 }; |
231 | 240 |
232 } // namespace content | 241 } // namespace content |
233 | 242 |
234 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 243 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
OLD | NEW |