| 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 #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 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1540   done_ = true; | 1540   done_ = true; | 
| 1541 | 1541 | 
| 1542   // Notify NetworkQualityEstimator. | 1542   // Notify NetworkQualityEstimator. | 
| 1543   if (request() && (reason == FINISHED || reason == ABORTED)) { | 1543   if (request() && (reason == FINISHED || reason == ABORTED)) { | 
| 1544     NetworkQualityEstimator* network_quality_estimator = | 1544     NetworkQualityEstimator* network_quality_estimator = | 
| 1545         request()->context()->network_quality_estimator(); | 1545         request()->context()->network_quality_estimator(); | 
| 1546     if (network_quality_estimator) | 1546     if (network_quality_estimator) | 
| 1547       network_quality_estimator->NotifyRequestCompleted(*request()); | 1547       network_quality_estimator->NotifyRequestCompleted(*request()); | 
| 1548   } | 1548   } | 
| 1549 | 1549 | 
|  | 1550   // Notify about any new network usage. | 
|  | 1551   MaybeNotifyNetworkBytes(); | 
|  | 1552 | 
| 1550   RecordPerfHistograms(reason); | 1553   RecordPerfHistograms(reason); | 
| 1551   if (request_) | 1554   if (request_) | 
| 1552     request_->set_received_response_content_length(prefilter_bytes_read()); | 1555     request_->set_received_response_content_length(prefilter_bytes_read()); | 
| 1553 } | 1556 } | 
| 1554 | 1557 | 
| 1555 HttpResponseHeaders* URLRequestHttpJob::GetResponseHeaders() const { | 1558 HttpResponseHeaders* URLRequestHttpJob::GetResponseHeaders() const { | 
| 1556   DCHECK(transaction_.get()); | 1559   DCHECK(transaction_.get()); | 
| 1557   DCHECK(transaction_->GetResponseInfo()); | 1560   DCHECK(transaction_->GetResponseInfo()); | 
| 1558   return override_response_headers_.get() ? | 1561   return override_response_headers_.get() ? | 
| 1559              override_response_headers_.get() : | 1562              override_response_headers_.get() : | 
| 1560              transaction_->GetResponseInfo()->headers.get(); | 1563              transaction_->GetResponseInfo()->headers.get(); | 
| 1561 } | 1564 } | 
| 1562 | 1565 | 
| 1563 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1566 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 
| 1564   awaiting_callback_ = false; | 1567   awaiting_callback_ = false; | 
| 1565 } | 1568 } | 
| 1566 | 1569 | 
| 1567 }  // namespace net | 1570 }  // namespace net | 
| OLD | NEW | 
|---|