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 <string> | 10 #include <string> |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 // Subclasses may implement this method to record packet arrival times. | 396 // Subclasses may implement this method to record packet arrival times. |
397 // The default implementation does nothing. Only invoked when bytes have been | 397 // The default implementation does nothing. Only invoked when bytes have been |
398 // read since the last invocation. | 398 // read since the last invocation. |
399 virtual void UpdatePacketReadTimes(); | 399 virtual void UpdatePacketReadTimes(); |
400 | 400 |
401 // Computes a new RedirectInfo based on receiving a redirect response of | 401 // Computes a new RedirectInfo based on receiving a redirect response of |
402 // |location| and |http_status_code|. | 402 // |location| and |http_status_code|. |
403 RedirectInfo ComputeRedirectInfo(const GURL& location, int http_status_code); | 403 RedirectInfo ComputeRedirectInfo(const GURL& location, int http_status_code); |
404 | 404 |
405 // Notify the network delegate that more bytes have been received over the | 405 // Notify the network delegate that more bytes have been received or sent over |
406 // network, if bytes have been received since the previous notification. | 406 // the network, if bytes have been received or sent since the previous |
407 // TODO(sclittle): Have this method also notify about sent bytes once | 407 // notification. |
408 // URLRequestJob::GetTotalSentBytes has been implemented (crbug.com/518897). | |
409 void MaybeNotifyNetworkBytes(); | 408 void MaybeNotifyNetworkBytes(); |
410 | 409 |
411 // Indicates that the job is done producing data, either it has completed | 410 // Indicates that the job is done producing data, either it has completed |
412 // all the data or an error has been encountered. Set exclusively by | 411 // all the data or an error has been encountered. Set exclusively by |
413 // NotifyDone so that it is kept in sync with the request. | 412 // NotifyDone so that it is kept in sync with the request. |
414 bool done_; | 413 bool done_; |
415 | 414 |
416 int64 prefilter_bytes_read_; | 415 int64 prefilter_bytes_read_; |
417 int64 postfilter_bytes_read_; | 416 int64 postfilter_bytes_read_; |
418 | 417 |
(...skipping 26 matching lines...) Expand all Loading... |
445 RedirectInfo deferred_redirect_info_; | 444 RedirectInfo deferred_redirect_info_; |
446 | 445 |
447 // The network delegate to use with this request, if any. | 446 // The network delegate to use with this request, if any. |
448 NetworkDelegate* network_delegate_; | 447 NetworkDelegate* network_delegate_; |
449 | 448 |
450 // The value from GetTotalReceivedBytes() the last time | 449 // The value from GetTotalReceivedBytes() the last time |
451 // MaybeNotifyNetworkBytes() was called. Used to calculate how bytes have been | 450 // MaybeNotifyNetworkBytes() was called. Used to calculate how bytes have been |
452 // newly received since the last notification. | 451 // newly received since the last notification. |
453 int64_t last_notified_total_received_bytes_; | 452 int64_t last_notified_total_received_bytes_; |
454 | 453 |
| 454 // The value from GetTotalSentBytes() the last time MaybeNotifyNetworkBytes() |
| 455 // was called. Used to calculate how bytes have been newly sent since the last |
| 456 // notification. |
| 457 int64_t last_notified_total_sent_bytes_; |
| 458 |
455 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 459 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
456 | 460 |
457 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 461 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
458 }; | 462 }; |
459 | 463 |
460 } // namespace net | 464 } // namespace net |
461 | 465 |
462 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 466 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |