| Index: net/url_request/url_request_job.cc
|
| diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc
|
| index 732c9d2da3a63a7374ea742a4b42575aae50ed1a..aa20224d4babc31b784fb3c8c2743c35af73eb72 100644
|
| --- a/net/url_request/url_request_job.cc
|
| +++ b/net/url_request/url_request_job.cc
|
| @@ -73,6 +73,7 @@ URLRequestJob::URLRequestJob(URLRequest* request,
|
| expected_content_size_(-1),
|
| network_delegate_(network_delegate),
|
| last_notified_total_received_bytes_(0),
|
| + last_notified_total_sent_bytes_(0),
|
| weak_factory_(this) {
|
| base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
|
| if (power_monitor)
|
| @@ -937,6 +938,7 @@ void URLRequestJob::MaybeNotifyNetworkBytes() {
|
| if (!request_ || !network_delegate_)
|
| return;
|
|
|
| + // Report any new received bytes.
|
| int64_t total_received_bytes = GetTotalReceivedBytes();
|
| DCHECK_GE(total_received_bytes, last_notified_total_received_bytes_);
|
| if (total_received_bytes > last_notified_total_received_bytes_) {
|
| @@ -944,6 +946,15 @@ void URLRequestJob::MaybeNotifyNetworkBytes() {
|
| *request_, total_received_bytes - last_notified_total_received_bytes_);
|
| }
|
| last_notified_total_received_bytes_ = total_received_bytes;
|
| +
|
| + // Report any new sent bytes.
|
| + int64_t total_sent_bytes = GetTotalSentBytes();
|
| + DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_);
|
| + if (total_sent_bytes > last_notified_total_sent_bytes_) {
|
| + network_delegate_->NotifyNetworkBytesSent(
|
| + *request_, total_sent_bytes - last_notified_total_sent_bytes_);
|
| + }
|
| + last_notified_total_sent_bytes_ = total_sent_bytes;
|
| }
|
|
|
| } // namespace net
|
|
|