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 NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 // still present to assist in calculations. This is used by URLRequestHttpJob | 280 // still present to assist in calculations. This is used by URLRequestHttpJob |
281 // to get SDCH to emit stats. | 281 // to get SDCH to emit stats. |
282 void DestroyFilters() { filter_.reset(); } | 282 void DestroyFilters() { filter_.reset(); } |
283 | 283 |
284 // The status of the job. | 284 // The status of the job. |
285 const URLRequestStatus GetStatus(); | 285 const URLRequestStatus GetStatus(); |
286 | 286 |
287 // Set the status of the job. | 287 // Set the status of the job. |
288 void SetStatus(const URLRequestStatus& status); | 288 void SetStatus(const URLRequestStatus& status); |
289 | 289 |
| 290 // Custom handler for derived classes when the request is detached. |
| 291 virtual void OnDetachRequest() { } |
| 292 |
290 // The number of bytes read before passing to the filter. | 293 // The number of bytes read before passing to the filter. |
291 int prefilter_bytes_read() const { return prefilter_bytes_read_; } | 294 int prefilter_bytes_read() const { return prefilter_bytes_read_; } |
292 | 295 |
293 // The number of bytes read after passing through the filter. | 296 // The number of bytes read after passing through the filter. |
294 int postfilter_bytes_read() const { return postfilter_bytes_read_; } | 297 int postfilter_bytes_read() const { return postfilter_bytes_read_; } |
295 | 298 |
296 // Total number of bytes read from network (or cache) and typically handed | 299 // Total number of bytes read from network (or cache) and typically handed |
297 // to filter to process. Used to histogram compression ratios, and error | 300 // to filter to process. Used to histogram compression ratios, and error |
298 // recovery scenarios in filters. | 301 // recovery scenarios in filters. |
299 int64 filter_input_byte_count() const { return filter_input_byte_count_; } | 302 int64 filter_input_byte_count() const { return filter_input_byte_count_; } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 NetworkDelegate* network_delegate_; | 379 NetworkDelegate* network_delegate_; |
377 | 380 |
378 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 381 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
379 | 382 |
380 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 383 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
381 }; | 384 }; |
382 | 385 |
383 } // namespace net | 386 } // namespace net |
384 | 387 |
385 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 388 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |