OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // the data, and bytes_read will receive the number of bytes read. | 239 // the data, and bytes_read will receive the number of bytes read. |
240 // If returning true, and bytes_read is returned as 0, there is no | 240 // If returning true, and bytes_read is returned as 0, there is no |
241 // additional data to be read. | 241 // additional data to be read. |
242 // If returning false, an error occurred or an async IO is now pending. | 242 // If returning false, an error occurred or an async IO is now pending. |
243 // If async IO is pending, the status of the request will be | 243 // If async IO is pending, the status of the request will be |
244 // URLRequestStatus::IO_PENDING, and buf must remain available until the | 244 // URLRequestStatus::IO_PENDING, and buf must remain available until the |
245 // operation is completed. See comments on URLRequest::Read for more | 245 // operation is completed. See comments on URLRequest::Read for more |
246 // info. | 246 // info. |
247 virtual bool ReadRawData(IOBuffer* buf, int buf_size, int *bytes_read); | 247 virtual bool ReadRawData(IOBuffer* buf, int buf_size, int *bytes_read); |
248 | 248 |
| 249 // Called to tell the job that a filter has successfully reached the end of |
| 250 // the stream. |
| 251 virtual void DoneReading(); |
| 252 |
249 // Informs the filter that data has been read into its buffer | 253 // Informs the filter that data has been read into its buffer |
250 void FilteredDataRead(int bytes_read); | 254 void FilteredDataRead(int bytes_read); |
251 | 255 |
252 // Reads filtered data from the request. Returns true if successful, | 256 // Reads filtered data from the request. Returns true if successful, |
253 // false otherwise. Note, if there is not enough data received to | 257 // false otherwise. Note, if there is not enough data received to |
254 // return data, this call can issue a new async IO request under | 258 // return data, this call can issue a new async IO request under |
255 // the hood. | 259 // the hood. |
256 bool ReadFilteredData(int *bytes_read); | 260 bool ReadFilteredData(int *bytes_read); |
257 | 261 |
258 // Whether the response is being filtered in this job. | 262 // Whether the response is being filtered in this job. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 int deferred_redirect_status_code_; | 362 int deferred_redirect_status_code_; |
359 | 363 |
360 ScopedRunnableMethodFactory<URLRequestJob> method_factory_; | 364 ScopedRunnableMethodFactory<URLRequestJob> method_factory_; |
361 | 365 |
362 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 366 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
363 }; | 367 }; |
364 | 368 |
365 } // namespace net | 369 } // namespace net |
366 | 370 |
367 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 371 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |