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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.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 "net/base/load_states.h" | 19 #include "net/base/load_states.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class CrossSiteResourceHandler; | 22 class CrossSiteResourceHandler; |
23 class DetachableResourceHandler; | 23 class DetachableResourceHandler; |
24 class ResourceContext; | 24 class ResourceContext; |
25 class ResourceMessageFilter; | 25 class ResourceMessageFilter; |
| 26 class ScheduledResourceRequest; |
26 struct GlobalRequestID; | 27 struct GlobalRequestID; |
27 struct GlobalRoutingID; | 28 struct GlobalRoutingID; |
28 | 29 |
29 // Holds the data ResourceDispatcherHost associates with each request. | 30 // Holds the data ResourceDispatcherHost associates with each request. |
30 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. | 31 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. |
31 class ResourceRequestInfoImpl : public ResourceRequestInfo, | 32 class ResourceRequestInfoImpl : public ResourceRequestInfo, |
32 public base::SupportsUserData::Data { | 33 public base::SupportsUserData::Data { |
33 public: | 34 public: |
34 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. | 35 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. |
35 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( | 36 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 void set_memory_cost(int cost) { memory_cost_ = cost; } | 172 void set_memory_cost(int cost) { memory_cost_ = cost; } |
172 | 173 |
173 bool is_load_timing_enabled() const { return enable_load_timing_; } | 174 bool is_load_timing_enabled() const { return enable_load_timing_; } |
174 | 175 |
175 bool is_upload_progress_enabled() const { return enable_upload_progress_; } | 176 bool is_upload_progress_enabled() const { return enable_upload_progress_; } |
176 | 177 |
177 bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; } | 178 bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; } |
178 void set_do_not_prompt_for_login(bool do_not_prompt) { | 179 void set_do_not_prompt_for_login(bool do_not_prompt) { |
179 do_not_prompt_for_login_ = do_not_prompt; | 180 do_not_prompt_for_login_ = do_not_prompt; |
180 } | 181 } |
| 182 ScheduledResourceRequest* scheduled_resource_request() const { |
| 183 return scheduled_resource_request_; |
| 184 } |
| 185 void set_scheduled_resource_request( |
| 186 ScheduledResourceRequest* scheduled_resource_request) { |
| 187 scheduled_resource_request_ = scheduled_resource_request; |
| 188 } |
181 | 189 |
182 private: | 190 private: |
183 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 191 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
184 DeletedFilterDetached); | 192 DeletedFilterDetached); |
185 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 193 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
186 DeletedFilterDetachedRedirect); | 194 DeletedFilterDetachedRedirect); |
187 // Non-owning, may be NULL. | 195 // Non-owning, may be NULL. |
188 CrossSiteResourceHandler* cross_site_handler_; | 196 CrossSiteResourceHandler* cross_site_handler_; |
189 DetachableResourceHandler* detachable_handler_; | 197 DetachableResourceHandler* detachable_handler_; |
190 | 198 |
(...skipping 16 matching lines...) Expand all Loading... |
207 bool enable_upload_progress_; | 215 bool enable_upload_progress_; |
208 bool do_not_prompt_for_login_; | 216 bool do_not_prompt_for_login_; |
209 bool was_ignored_by_handler_; | 217 bool was_ignored_by_handler_; |
210 bool counted_as_in_flight_request_; | 218 bool counted_as_in_flight_request_; |
211 ResourceType resource_type_; | 219 ResourceType resource_type_; |
212 ui::PageTransition transition_type_; | 220 ui::PageTransition transition_type_; |
213 int memory_cost_; | 221 int memory_cost_; |
214 blink::WebReferrerPolicy referrer_policy_; | 222 blink::WebReferrerPolicy referrer_policy_; |
215 blink::WebPageVisibilityState visibility_state_; | 223 blink::WebPageVisibilityState visibility_state_; |
216 ResourceContext* context_; | 224 ResourceContext* context_; |
| 225 ScheduledResourceRequest* scheduled_resource_request_; |
217 // The filter might be deleted without deleting this object if the process | 226 // The filter might be deleted without deleting this object if the process |
218 // exits during a transfer. | 227 // exits during a transfer. |
219 base::WeakPtr<ResourceMessageFilter> filter_; | 228 base::WeakPtr<ResourceMessageFilter> filter_; |
220 bool is_async_; | 229 bool is_async_; |
221 | 230 |
222 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 231 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
223 }; | 232 }; |
224 | 233 |
225 } // namespace content | 234 } // namespace content |
226 | 235 |
227 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 236 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
OLD | NEW |