| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 if (sdch_test_control_) | 254 if (sdch_test_control_) |
| 255 RecordPacketStats(SdchPolicyDelegate::SDCH_EXPERIMENT_HOLDBACK); | 255 RecordPacketStats(SdchPolicyDelegate::SDCH_EXPERIMENT_HOLDBACK); |
| 256 if (sdch_test_activated_) | 256 if (sdch_test_activated_) |
| 257 RecordPacketStats(SdchPolicyDelegate::SDCH_EXPERIMENT_DECODE); | 257 RecordPacketStats(SdchPolicyDelegate::SDCH_EXPERIMENT_DECODE); |
| 258 } | 258 } |
| 259 // Make sure SdchSourceStream are told to emit histogram data while |this| | 259 // Make sure SdchSourceStream are told to emit histogram data while |this| |
| 260 // is still alive. | 260 // is still alive. |
| 261 DestroySourceStream(); | 261 DestroySourceStream(); |
| 262 | 262 |
| 263 DoneWithRequest(ABORTED); | 263 DoneWithRequest(ABORTED); |
| 264 if (transaction_) { |
| 265 transaction_->Orphan(std::move(transaction_)); |
| 266 } |
| 264 } | 267 } |
| 265 | 268 |
| 266 void URLRequestHttpJob::SetPriority(RequestPriority priority) { | 269 void URLRequestHttpJob::SetPriority(RequestPriority priority) { |
| 267 priority_ = priority; | 270 priority_ = priority; |
| 268 if (transaction_) | 271 if (transaction_) |
| 269 transaction_->SetPriority(priority_); | 272 transaction_->SetPriority(priority_); |
| 270 } | 273 } |
| 271 | 274 |
| 272 void URLRequestHttpJob::Start() { | 275 void URLRequestHttpJob::Start() { |
| 273 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed. | 276 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 433 |
| 431 void URLRequestHttpJob::DestroyTransaction() { | 434 void URLRequestHttpJob::DestroyTransaction() { |
| 432 DCHECK(transaction_.get()); | 435 DCHECK(transaction_.get()); |
| 433 | 436 |
| 434 DoneWithRequest(ABORTED); | 437 DoneWithRequest(ABORTED); |
| 435 | 438 |
| 436 total_received_bytes_from_previous_transactions_ += | 439 total_received_bytes_from_previous_transactions_ += |
| 437 transaction_->GetTotalReceivedBytes(); | 440 transaction_->GetTotalReceivedBytes(); |
| 438 total_sent_bytes_from_previous_transactions_ += | 441 total_sent_bytes_from_previous_transactions_ += |
| 439 transaction_->GetTotalSentBytes(); | 442 transaction_->GetTotalSentBytes(); |
| 440 transaction_.reset(); | 443 transaction_->Orphan(std::move(transaction_)); |
| 441 response_info_ = NULL; | 444 response_info_ = NULL; |
| 442 receive_headers_end_ = base::TimeTicks(); | 445 receive_headers_end_ = base::TimeTicks(); |
| 443 } | 446 } |
| 444 | 447 |
| 445 void URLRequestHttpJob::StartTransaction() { | 448 void URLRequestHttpJob::StartTransaction() { |
| 446 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed. | 449 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed. |
| 447 tracked_objects::ScopedTracker tracking_profile( | 450 tracked_objects::ScopedTracker tracking_profile( |
| 448 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 451 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 449 "456327 URLRequestHttpJob::StartTransaction")); | 452 "456327 URLRequestHttpJob::StartTransaction")); |
| 450 | 453 |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 awaiting_callback_ = false; | 1542 awaiting_callback_ = false; |
| 1540 | 1543 |
| 1541 // Notify NetworkQualityEstimator. | 1544 // Notify NetworkQualityEstimator. |
| 1542 NetworkQualityEstimator* network_quality_estimator = | 1545 NetworkQualityEstimator* network_quality_estimator = |
| 1543 request()->context()->network_quality_estimator(); | 1546 request()->context()->network_quality_estimator(); |
| 1544 if (network_quality_estimator) | 1547 if (network_quality_estimator) |
| 1545 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1548 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
| 1546 } | 1549 } |
| 1547 | 1550 |
| 1548 } // namespace net | 1551 } // namespace net |
| OLD | NEW |