| 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 CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ | 6 #define CONTENT_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 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Holds the data ResourceDispatcherHost associates with each request. | 32 // Holds the data ResourceDispatcherHost associates with each request. |
| 33 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. | 33 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. |
| 34 class ResourceDispatcherHostRequestInfo : public net::URLRequest::UserData { | 34 class ResourceDispatcherHostRequestInfo : public net::URLRequest::UserData { |
| 35 public: | 35 public: |
| 36 // This will take a reference to the handler. | 36 // This will take a reference to the handler. |
| 37 ResourceDispatcherHostRequestInfo( | 37 ResourceDispatcherHostRequestInfo( |
| 38 ResourceHandler* handler, | 38 ResourceHandler* handler, |
| 39 ChildProcessInfo::ProcessType process_type, | 39 ChildProcessInfo::ProcessType process_type, |
| 40 int child_id, | 40 int child_id, |
| 41 int route_id, | 41 int route_id, |
| 42 int origin_pid, |
| 42 int request_id, | 43 int request_id, |
| 43 ResourceType::Type resource_type, | 44 ResourceType::Type resource_type, |
| 44 uint64 upload_size, | 45 uint64 upload_size, |
| 45 bool is_download, | 46 bool is_download, |
| 46 bool allow_download, | 47 bool allow_download, |
| 47 bool has_user_gesture, | 48 bool has_user_gesture, |
| 48 const content::ResourceContext* context); | 49 const content::ResourceContext* context); |
| 49 virtual ~ResourceDispatcherHostRequestInfo(); | 50 virtual ~ResourceDispatcherHostRequestInfo(); |
| 50 | 51 |
| 51 // Top-level ResourceHandler servicing this request. | 52 // Top-level ResourceHandler servicing this request. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 78 | 79 |
| 79 // The child process unique ID of the requestor. This duplicates the value | 80 // The child process unique ID of the requestor. This duplicates the value |
| 80 // stored on the request by SetChildProcessUniqueIDForRequest in | 81 // stored on the request by SetChildProcessUniqueIDForRequest in |
| 81 // url_request_tracking. | 82 // url_request_tracking. |
| 82 int child_id() const { return child_id_; } | 83 int child_id() const { return child_id_; } |
| 83 | 84 |
| 84 // The IPC route identifier for this request (this identifies the RenderView | 85 // The IPC route identifier for this request (this identifies the RenderView |
| 85 // or like-thing in the renderer that the request gets routed to). | 86 // or like-thing in the renderer that the request gets routed to). |
| 86 int route_id() const { return route_id_; } | 87 int route_id() const { return route_id_; } |
| 87 | 88 |
| 89 // The pid of the originating process, if the request is sent on behalf of a |
| 90 // another process. Otherwise it is 0. |
| 91 int origin_pid() const { return origin_pid_; } |
| 92 |
| 88 // Unique identifier for this resource request. | 93 // Unique identifier for this resource request. |
| 89 int request_id() const { return request_id_; } | 94 int request_id() const { return request_id_; } |
| 90 | 95 |
| 91 // Number of messages we've sent to the renderer that we haven't gotten an | 96 // Number of messages we've sent to the renderer that we haven't gotten an |
| 92 // ACK for. This allows us to avoid having too many messages in flight. | 97 // ACK for. This allows us to avoid having too many messages in flight. |
| 93 int pending_data_count() const { return pending_data_count_; } | 98 int pending_data_count() const { return pending_data_count_; } |
| 94 void IncrementPendingDataCount() { pending_data_count_++; } | 99 void IncrementPendingDataCount() { pending_data_count_++; } |
| 95 void DecrementPendingDataCount() { pending_data_count_--; } | 100 void DecrementPendingDataCount() { pending_data_count_--; } |
| 96 | 101 |
| 97 // Downloads are allowed only as a top level request. | 102 // Downloads are allowed only as a top level request. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 int paused_read_bytes() const { return paused_read_bytes_; } | 194 int paused_read_bytes() const { return paused_read_bytes_; } |
| 190 void set_paused_read_bytes(int bytes) { paused_read_bytes_ = bytes; } | 195 void set_paused_read_bytes(int bytes) { paused_read_bytes_ = bytes; } |
| 191 | 196 |
| 192 scoped_refptr<ResourceHandler> resource_handler_; | 197 scoped_refptr<ResourceHandler> resource_handler_; |
| 193 CrossSiteResourceHandler* cross_site_handler_; // Non-owning, may be NULL. | 198 CrossSiteResourceHandler* cross_site_handler_; // Non-owning, may be NULL. |
| 194 scoped_refptr<LoginHandler> login_handler_; | 199 scoped_refptr<LoginHandler> login_handler_; |
| 195 scoped_refptr<SSLClientAuthHandler> ssl_client_auth_handler_; | 200 scoped_refptr<SSLClientAuthHandler> ssl_client_auth_handler_; |
| 196 ChildProcessInfo::ProcessType process_type_; | 201 ChildProcessInfo::ProcessType process_type_; |
| 197 int child_id_; | 202 int child_id_; |
| 198 int route_id_; | 203 int route_id_; |
| 204 int origin_pid_; |
| 199 int request_id_; | 205 int request_id_; |
| 200 int pending_data_count_; | 206 int pending_data_count_; |
| 201 bool is_download_; | 207 bool is_download_; |
| 202 bool allow_download_; | 208 bool allow_download_; |
| 203 bool has_user_gesture_; | 209 bool has_user_gesture_; |
| 204 int pause_count_; | 210 int pause_count_; |
| 205 ResourceType::Type resource_type_; | 211 ResourceType::Type resource_type_; |
| 206 net::LoadState last_load_state_; | 212 net::LoadState last_load_state_; |
| 207 uint64 upload_size_; | 213 uint64 upload_size_; |
| 208 uint64 last_upload_position_; | 214 uint64 last_upload_position_; |
| 209 base::TimeTicks last_upload_ticks_; | 215 base::TimeTicks last_upload_ticks_; |
| 210 bool waiting_for_upload_progress_ack_; | 216 bool waiting_for_upload_progress_ack_; |
| 211 int memory_cost_; | 217 int memory_cost_; |
| 212 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; | 218 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; |
| 213 const content::ResourceContext* context_; | 219 const content::ResourceContext* context_; |
| 214 | 220 |
| 215 // "Private" data accessible only to ResourceDispatcherHost (use the | 221 // "Private" data accessible only to ResourceDispatcherHost (use the |
| 216 // accessors above for consistency). | 222 // accessors above for consistency). |
| 217 bool is_paused_; | 223 bool is_paused_; |
| 218 bool called_on_response_started_; | 224 bool called_on_response_started_; |
| 219 bool has_started_reading_; | 225 bool has_started_reading_; |
| 220 int paused_read_bytes_; | 226 int paused_read_bytes_; |
| 221 | 227 |
| 222 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostRequestInfo); | 228 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostRequestInfo); |
| 223 }; | 229 }; |
| 224 | 230 |
| 225 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H
_ | 231 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H
_ |
| OLD | NEW |