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