| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 void SetProxyServer(const HostPortPair& proxy_server); | 346 void SetProxyServer(const HostPortPair& proxy_server); |
| 347 | 347 |
| 348 // The number of bytes read before passing to the filter. This value reflects | 348 // The number of bytes read before passing to the filter. This value reflects |
| 349 // bytes read even when there is no filter. | 349 // bytes read even when there is no filter. |
| 350 int64 prefilter_bytes_read() const { return prefilter_bytes_read_; } | 350 int64 prefilter_bytes_read() const { return prefilter_bytes_read_; } |
| 351 | 351 |
| 352 // The number of bytes read after passing through the filter. This value | 352 // The number of bytes read after passing through the filter. This value |
| 353 // reflects bytes read even when there is no filter. | 353 // reflects bytes read even when there is no filter. |
| 354 int64 postfilter_bytes_read() const { return postfilter_bytes_read_; } | 354 int64 postfilter_bytes_read() const { return postfilter_bytes_read_; } |
| 355 | 355 |
| 356 // Notify the network delegate that more bytes have been received over the |
| 357 // network, if bytes have been received since the previous notification. |
| 358 // TODO(sclittle): Have this method also notify about sent bytes once |
| 359 // URLRequestJob::GetTotalSentBytes has been implemented (crbug.com/518897). |
| 360 void MaybeNotifyNetworkBytes(); |
| 361 |
| 356 // The request that initiated this job. This value MAY BE NULL if the | 362 // The request that initiated this job. This value MAY BE NULL if the |
| 357 // request was released by DetachRequest(). | 363 // request was released by DetachRequest(). |
| 358 URLRequest* request_; | 364 URLRequest* request_; |
| 359 | 365 |
| 360 private: | 366 private: |
| 361 // When data filtering is enabled, this function is used to read data | 367 // When data filtering is enabled, this function is used to read data |
| 362 // for the filter. Returns true if raw data was read. Returns false if | 368 // for the filter. Returns true if raw data was read. Returns false if |
| 363 // an error occurred (or we are waiting for IO to complete). | 369 // an error occurred (or we are waiting for IO to complete). |
| 364 bool ReadRawDataForFilter(int *bytes_read); | 370 bool ReadRawDataForFilter(int *bytes_read); |
| 365 | 371 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 433 |
| 428 // Expected content size | 434 // Expected content size |
| 429 int64 expected_content_size_; | 435 int64 expected_content_size_; |
| 430 | 436 |
| 431 // Set when a redirect is deferred. | 437 // Set when a redirect is deferred. |
| 432 RedirectInfo deferred_redirect_info_; | 438 RedirectInfo deferred_redirect_info_; |
| 433 | 439 |
| 434 // The network delegate to use with this request, if any. | 440 // The network delegate to use with this request, if any. |
| 435 NetworkDelegate* network_delegate_; | 441 NetworkDelegate* network_delegate_; |
| 436 | 442 |
| 443 // The value from GetTotalReceivedBytes() the last time |
| 444 // MaybeNotifyNetworkBytes() was called. Used to calculate how bytes have been |
| 445 // newly received since the last notification. |
| 446 int64 last_notified_total_received_bytes_; |
| 447 |
| 437 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 448 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
| 438 | 449 |
| 439 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 450 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
| 440 }; | 451 }; |
| 441 | 452 |
| 442 } // namespace net | 453 } // namespace net |
| 443 | 454 |
| 444 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 455 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
| OLD | NEW |