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 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 // Turns an integer result code into an Error and a count of bytes read. | 342 // Turns an integer result code into an Error and a count of bytes read. |
343 // The semantics are: | 343 // The semantics are: |
344 // |result| >= 0: |*error| == OK, |*count| == |result| | 344 // |result| >= 0: |*error| == OK, |*count| == |result| |
345 // |result| < 0: |*error| = |result|, |*count| == 0 | 345 // |result| < 0: |*error| = |result|, |*count| == 0 |
346 static void ConvertResultToError(int result, Error* error, int* count); | 346 static void ConvertResultToError(int result, Error* error, int* count); |
347 | 347 |
348 // Completion callback for raw reads. See |ReadRawData| for details. | 348 // Completion callback for raw reads. See |ReadRawData| for details. |
349 // |bytes_read| is either >= 0 to indicate a successful read and count of | 349 // |bytes_read| is either >= 0 to indicate a successful read and count of |
350 // bytes read, or < 0 to indicate an error. | 350 // bytes read, or < 0 to indicate an error. |
| 351 // On return, |this| may be deleted. |
351 void ReadRawDataComplete(int bytes_read); | 352 void ReadRawDataComplete(int bytes_read); |
352 | 353 |
353 // The request that initiated this job. This value will never be nullptr. | 354 // The request that initiated this job. This value will never be nullptr. |
354 URLRequest* request_; | 355 URLRequest* request_; |
355 | 356 |
356 private: | 357 private: |
357 // When data filtering is enabled, this function is used to read data | 358 // When data filtering is enabled, this function is used to read data |
358 // for the filter. Returns a net error code to indicate if raw data was | 359 // for the filter. Returns a net error code to indicate if raw data was |
359 // successfully read, an error happened, or the IO is pending. | 360 // successfully read, an error happened, or the IO is pending. |
360 Error ReadRawDataForFilter(int* bytes_read); | 361 Error ReadRawDataForFilter(int* bytes_read); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 int64_t last_notified_total_sent_bytes_; | 460 int64_t last_notified_total_sent_bytes_; |
460 | 461 |
461 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 462 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
462 | 463 |
463 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 464 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
464 }; | 465 }; |
465 | 466 |
466 } // namespace net | 467 } // namespace net |
467 | 468 |
468 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 469 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |