OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "chrome/common/child_process_info.h" | 13 #include "chrome/common/child_process_info.h" |
14 #include "net/base/load_states.h" | 14 #include "net/base/load_states.h" |
15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
16 #include "webkit/glue/resource_type.h" | 16 #include "webkit/glue/resource_type.h" |
17 | 17 |
18 class CrossSiteResourceHandler; | 18 class CrossSiteResourceHandler; |
19 class LoginHandler; | 19 class LoginHandler; |
20 class ResourceDispatcherHost; | 20 class ResourceDispatcherHost; |
21 class ResourceHandler; | 21 class ResourceHandler; |
22 class SSLClientAuthHandler; | 22 class SSLClientAuthHandler; |
23 | 23 |
24 namespace webkit_blob { | |
25 class BlobData; | |
26 } | |
27 | |
28 // Holds the data ResourceDispatcherHost associates with each request. | 24 // Holds the data ResourceDispatcherHost associates with each request. |
29 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. | 25 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. |
30 class ResourceDispatcherHostRequestInfo : public URLRequest::UserData { | 26 class ResourceDispatcherHostRequestInfo : public URLRequest::UserData { |
31 public: | 27 public: |
32 // This will take a reference to the handler. | 28 // This will take a reference to the handler. |
33 ResourceDispatcherHostRequestInfo( | 29 ResourceDispatcherHostRequestInfo( |
34 ResourceHandler* handler, | 30 ResourceHandler* handler, |
35 ChildProcessInfo::ProcessType process_type, | 31 ChildProcessInfo::ProcessType process_type, |
36 int child_id, | 32 int child_id, |
37 int route_id, | 33 int route_id, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 153 } |
158 | 154 |
159 // The approximate in-memory size (bytes) that we credited this request | 155 // The approximate in-memory size (bytes) that we credited this request |
160 // as consuming in |outstanding_requests_memory_cost_map_|. | 156 // as consuming in |outstanding_requests_memory_cost_map_|. |
161 int memory_cost() const { return memory_cost_; } | 157 int memory_cost() const { return memory_cost_; } |
162 void set_memory_cost(int cost) { memory_cost_ = cost; } | 158 void set_memory_cost(int cost) { memory_cost_ = cost; } |
163 | 159 |
164 int host_renderer_id() const { return host_renderer_id_; } | 160 int host_renderer_id() const { return host_renderer_id_; } |
165 int host_render_view_id() const { return host_render_view_id_; } | 161 int host_render_view_id() const { return host_render_view_id_; } |
166 | 162 |
167 // We hold a reference to the requested blob data to ensure it doesn't | |
168 // get finally released prior to the URLRequestJob being started. | |
169 webkit_blob::BlobData* requested_blob_data() const { | |
170 return requested_blob_data_.get(); | |
171 } | |
172 void set_requested_blob_data(webkit_blob::BlobData* data); | |
173 | |
174 private: | 163 private: |
175 friend class ResourceDispatcherHost; | 164 friend class ResourceDispatcherHost; |
176 | 165 |
177 // Request is temporarily not handling network data. Should be used only | 166 // Request is temporarily not handling network data. Should be used only |
178 // by the ResourceDispatcherHost, not the event handlers (accessors are | 167 // by the ResourceDispatcherHost, not the event handlers (accessors are |
179 // provided for consistency with the rest of the interface). | 168 // provided for consistency with the rest of the interface). |
180 bool is_paused() const { return is_paused_; } | 169 bool is_paused() const { return is_paused_; } |
181 void set_is_paused(bool paused) { is_paused_ = paused; } | 170 void set_is_paused(bool paused) { is_paused_ = paused; } |
182 | 171 |
183 // Whether we called OnResponseStarted for this request or not. Should be used | 172 // Whether we called OnResponseStarted for this request or not. Should be used |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 std::string frame_origin_; | 207 std::string frame_origin_; |
219 std::string main_frame_origin_; | 208 std::string main_frame_origin_; |
220 ResourceType::Type resource_type_; | 209 ResourceType::Type resource_type_; |
221 bool replace_extension_localization_templates_; | 210 bool replace_extension_localization_templates_; |
222 net::LoadState last_load_state_; | 211 net::LoadState last_load_state_; |
223 uint64 upload_size_; | 212 uint64 upload_size_; |
224 uint64 last_upload_position_; | 213 uint64 last_upload_position_; |
225 base::TimeTicks last_upload_ticks_; | 214 base::TimeTicks last_upload_ticks_; |
226 bool waiting_for_upload_progress_ack_; | 215 bool waiting_for_upload_progress_ack_; |
227 int memory_cost_; | 216 int memory_cost_; |
228 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; | |
229 | 217 |
230 // "Private" data accessible only to ResourceDispatcherHost (use the | 218 // "Private" data accessible only to ResourceDispatcherHost (use the |
231 // accessors above for consistency). | 219 // accessors above for consistency). |
232 bool is_paused_; | 220 bool is_paused_; |
233 bool called_on_response_started_; | 221 bool called_on_response_started_; |
234 bool has_started_reading_; | 222 bool has_started_reading_; |
235 int paused_read_bytes_; | 223 int paused_read_bytes_; |
236 | 224 |
237 // The following two members are specified if the request is initiated by | 225 // The following two members are specified if the request is initiated by |
238 // a plugin like Gears. | 226 // a plugin like Gears. |
239 | 227 |
240 // Contains the id of the host renderer. | 228 // Contains the id of the host renderer. |
241 int host_renderer_id_; | 229 int host_renderer_id_; |
242 // Contains the id of the host render view. | 230 // Contains the id of the host render view. |
243 int host_render_view_id_; | 231 int host_render_view_id_; |
244 | 232 |
245 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostRequestInfo); | 233 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostRequestInfo); |
246 }; | 234 }; |
247 | 235 |
248 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ | 236 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ |
OLD | NEW |