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 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 // The approximate in-memory size (bytes) that we credited this request | 155 // The approximate in-memory size (bytes) that we credited this request |
156 // as consuming in |outstanding_requests_memory_cost_map_|. | 156 // as consuming in |outstanding_requests_memory_cost_map_|. |
157 int memory_cost() const { return memory_cost_; } | 157 int memory_cost() const { return memory_cost_; } |
158 void set_memory_cost(int cost) { memory_cost_ = cost; } | 158 void set_memory_cost(int cost) { memory_cost_ = cost; } |
159 | 159 |
160 int host_renderer_id() const { return host_renderer_id_; } | 160 int host_renderer_id() const { return host_renderer_id_; } |
161 int host_render_view_id() const { return host_render_view_id_; } | 161 int host_render_view_id() const { return host_render_view_id_; } |
162 | 162 |
| 163 // Request had a network error, and a new request must be issued. Should be |
| 164 // used only by DownloadResourceHandler::OnResponseStarted(). |
| 165 bool was_interrupted() const { return was_interrupted_; } |
| 166 void set_was_interrupted(bool interrupted) { was_interrupted_ = interrupted; } |
| 167 |
| 168 // How many bytes were read before this request was interrupted. |
| 169 int64 interrupted_bytes() const { return interrupted_bytes_; } |
| 170 void set_interrupted_bytes(int64 bytes) { interrupted_bytes_ = bytes; } |
| 171 |
163 private: | 172 private: |
164 friend class ResourceDispatcherHost; | 173 friend class ResourceDispatcherHost; |
165 | 174 |
166 // Request is temporarily not handling network data. Should be used only | 175 // Request is temporarily not handling network data. Should be used only |
167 // by the ResourceDispatcherHost, not the event handlers (accessors are | 176 // by the ResourceDispatcherHost, not the event handlers (accessors are |
168 // provided for consistency with the rest of the interface). | 177 // provided for consistency with the rest of the interface). |
169 bool is_paused() const { return is_paused_; } | 178 bool is_paused() const { return is_paused_; } |
170 void set_is_paused(bool paused) { is_paused_ = paused; } | 179 void set_is_paused(bool paused) { is_paused_ = paused; } |
171 | 180 |
172 // Whether we called OnResponseStarted for this request or not. Should be used | 181 // Whether we called OnResponseStarted for this request or not. Should be used |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 base::TimeTicks last_upload_ticks_; | 223 base::TimeTicks last_upload_ticks_; |
215 bool waiting_for_upload_progress_ack_; | 224 bool waiting_for_upload_progress_ack_; |
216 int memory_cost_; | 225 int memory_cost_; |
217 | 226 |
218 // "Private" data accessible only to ResourceDispatcherHost (use the | 227 // "Private" data accessible only to ResourceDispatcherHost (use the |
219 // accessors above for consistency). | 228 // accessors above for consistency). |
220 bool is_paused_; | 229 bool is_paused_; |
221 bool called_on_response_started_; | 230 bool called_on_response_started_; |
222 bool has_started_reading_; | 231 bool has_started_reading_; |
223 int paused_read_bytes_; | 232 int paused_read_bytes_; |
| 233 bool was_interrupted_; |
| 234 int64 interrupted_bytes_; |
224 | 235 |
225 // The following two members are specified if the request is initiated by | 236 // The following two members are specified if the request is initiated by |
226 // a plugin like Gears. | 237 // a plugin like Gears. |
227 | 238 |
228 // Contains the id of the host renderer. | 239 // Contains the id of the host renderer. |
229 int host_renderer_id_; | 240 int host_renderer_id_; |
230 // Contains the id of the host render view. | 241 // Contains the id of the host render view. |
231 int host_render_view_id_; | 242 int host_render_view_id_; |
232 | 243 |
233 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostRequestInfo); | 244 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostRequestInfo); |
234 }; | 245 }; |
235 | 246 |
236 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ | 247 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_REQUEST_INFO_H_ |
OLD | NEW |