Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 1284993005: Notify NetworkDelegate when bytes have been received over the network. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed NetworkDelegate::OnRawBytesRead Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 done_ = true; 1534 done_ = true;
1535 1535
1536 // Notify NetworkQualityEstimator. 1536 // Notify NetworkQualityEstimator.
1537 if (request() && (reason == FINISHED || reason == ABORTED)) { 1537 if (request() && (reason == FINISHED || reason == ABORTED)) {
1538 NetworkQualityEstimator* network_quality_estimator = 1538 NetworkQualityEstimator* network_quality_estimator =
1539 request()->context()->network_quality_estimator(); 1539 request()->context()->network_quality_estimator();
1540 if (network_quality_estimator) 1540 if (network_quality_estimator)
1541 network_quality_estimator->NotifyRequestCompleted(*request()); 1541 network_quality_estimator->NotifyRequestCompleted(*request());
1542 } 1542 }
1543 1543
1544 // Notify about any new network usage.
1545 MaybeNotifyNetworkBytes();
mmenke 2015/08/19 15:48:41 Why is this needed, when we call this in NotifyDon
sclittle 2015/08/20 01:10:49 This notification is no longer needed now that URL
1546
1544 RecordPerfHistograms(reason); 1547 RecordPerfHistograms(reason);
1545 if (request_) 1548 if (request_)
1546 request_->set_received_response_content_length(prefilter_bytes_read()); 1549 request_->set_received_response_content_length(prefilter_bytes_read());
1547 } 1550 }
1548 1551
1549 HttpResponseHeaders* URLRequestHttpJob::GetResponseHeaders() const { 1552 HttpResponseHeaders* URLRequestHttpJob::GetResponseHeaders() const {
1550 DCHECK(transaction_.get()); 1553 DCHECK(transaction_.get());
1551 DCHECK(transaction_->GetResponseInfo()); 1554 DCHECK(transaction_->GetResponseInfo());
1552 return override_response_headers_.get() ? 1555 return override_response_headers_.get() ?
1553 override_response_headers_.get() : 1556 override_response_headers_.get() :
1554 transaction_->GetResponseInfo()->headers.get(); 1557 transaction_->GetResponseInfo()->headers.get();
1555 } 1558 }
1556 1559
1557 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1560 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1558 awaiting_callback_ = false; 1561 awaiting_callback_ = false;
1559 } 1562 }
1560 1563
1561 } // namespace net 1564 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698