| 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/common/resource_request_body_impl.h" | 16 #include "content/common/resource_request_body_impl.h" |
| 17 #include "content/public/browser/resource_request_info.h" | 17 #include "content/public/browser/resource_request_info.h" |
| 18 #include "content/public/common/referrer.h" | 18 #include "content/public/common/referrer.h" |
| 19 #include "content/public/common/resource_type.h" | 19 #include "content/public/common/resource_type.h" |
| 20 #include "net/base/load_states.h" | 20 #include "net/base/load_states.h" |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 class CrossSiteResourceHandler; | |
| 24 class DetachableResourceHandler; | 23 class DetachableResourceHandler; |
| 25 class ResourceContext; | 24 class ResourceContext; |
| 26 class ResourceMessageFilter; | 25 class ResourceMessageFilter; |
| 27 struct GlobalRequestID; | 26 struct GlobalRequestID; |
| 28 struct GlobalRoutingID; | 27 struct GlobalRoutingID; |
| 29 | 28 |
| 30 // Holds the data ResourceDispatcherHost associates with each request. | 29 // Holds the data ResourceDispatcherHost associates with each request. |
| 31 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. | 30 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. |
| 32 class ResourceRequestInfoImpl : public ResourceRequestInfo, | 31 class ResourceRequestInfoImpl : public ResourceRequestInfo, |
| 33 public base::SupportsUserData::Data { | 32 public base::SupportsUserData::Data { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // to a new renderer process. Not all data will change during a transfer. | 115 // to a new renderer process. Not all data will change during a transfer. |
| 117 // We do not expect the ResourceContext to change during navigation, so that | 116 // We do not expect the ResourceContext to change during navigation, so that |
| 118 // does not need to be updated. | 117 // does not need to be updated. |
| 119 void UpdateForTransfer(int child_id, | 118 void UpdateForTransfer(int child_id, |
| 120 int route_id, | 119 int route_id, |
| 121 int render_frame_id, | 120 int render_frame_id, |
| 122 int origin_pid, | 121 int origin_pid, |
| 123 int request_id, | 122 int request_id, |
| 124 base::WeakPtr<ResourceMessageFilter> filter); | 123 base::WeakPtr<ResourceMessageFilter> filter); |
| 125 | 124 |
| 126 // CrossSiteResourceHandler for this request. May be null. | |
| 127 CrossSiteResourceHandler* cross_site_handler() { | |
| 128 return cross_site_handler_; | |
| 129 } | |
| 130 void set_cross_site_handler(CrossSiteResourceHandler* h) { | |
| 131 cross_site_handler_ = h; | |
| 132 } | |
| 133 | |
| 134 // Whether this request is part of a navigation that should replace the | 125 // Whether this request is part of a navigation that should replace the |
| 135 // current session history entry. This state is shuffled up and down the stack | 126 // current session history entry. This state is shuffled up and down the stack |
| 136 // for request transfers. | 127 // for request transfers. |
| 137 bool should_replace_current_entry() const { | 128 bool should_replace_current_entry() const { |
| 138 return should_replace_current_entry_; | 129 return should_replace_current_entry_; |
| 139 } | 130 } |
| 140 | 131 |
| 141 // DetachableResourceHandler for this request. May be NULL. | 132 // DetachableResourceHandler for this request. May be NULL. |
| 142 DetachableResourceHandler* detachable_handler() const { | 133 DetachableResourceHandler* detachable_handler() const { |
| 143 return detachable_handler_; | 134 return detachable_handler_; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void set_initiated_in_secure_context_for_testing(bool secure) { | 188 void set_initiated_in_secure_context_for_testing(bool secure) { |
| 198 initiated_in_secure_context_ = secure; | 189 initiated_in_secure_context_ = secure; |
| 199 } | 190 } |
| 200 | 191 |
| 201 private: | 192 private: |
| 202 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 193 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 203 DeletedFilterDetached); | 194 DeletedFilterDetached); |
| 204 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 195 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 205 DeletedFilterDetachedRedirect); | 196 DeletedFilterDetachedRedirect); |
| 206 // Non-owning, may be NULL. | 197 // Non-owning, may be NULL. |
| 207 CrossSiteResourceHandler* cross_site_handler_; | |
| 208 DetachableResourceHandler* detachable_handler_; | 198 DetachableResourceHandler* detachable_handler_; |
| 209 | 199 |
| 210 int process_type_; | 200 int process_type_; |
| 211 int child_id_; | 201 int child_id_; |
| 212 int route_id_; | 202 int route_id_; |
| 213 const int frame_tree_node_id_; | 203 const int frame_tree_node_id_; |
| 214 int origin_pid_; | 204 int origin_pid_; |
| 215 int request_id_; | 205 int request_id_; |
| 216 int render_frame_id_; | 206 int render_frame_id_; |
| 217 bool is_main_frame_; | 207 bool is_main_frame_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 241 const std::string original_headers_; | 231 const std::string original_headers_; |
| 242 scoped_refptr<ResourceRequestBodyImpl> body_; | 232 scoped_refptr<ResourceRequestBodyImpl> body_; |
| 243 bool initiated_in_secure_context_; | 233 bool initiated_in_secure_context_; |
| 244 | 234 |
| 245 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 235 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
| 246 }; | 236 }; |
| 247 | 237 |
| 248 } // namespace content | 238 } // namespace content |
| 249 | 239 |
| 250 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 240 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| OLD | NEW |