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