| 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_job.h" | 5 #include "net/url_request/url_request_job.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 } | 522 } |
| 523 | 523 |
| 524 void URLRequestJob::ReadRawDataComplete(int result) { | 524 void URLRequestJob::ReadRawDataComplete(int result) { |
| 525 DCHECK(request_->status().is_io_pending()); | 525 DCHECK(request_->status().is_io_pending()); |
| 526 | 526 |
| 527 // TODO(cbentzel): Remove ScopedTracker below once crbug.com/475755 is fixed. | 527 // TODO(cbentzel): Remove ScopedTracker below once crbug.com/475755 is fixed. |
| 528 tracked_objects::ScopedTracker tracking_profile( | 528 tracked_objects::ScopedTracker tracking_profile( |
| 529 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 529 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 530 "475755 URLRequestJob::RawReadCompleted")); | 530 "475755 URLRequestJob::RawReadCompleted")); |
| 531 | 531 |
| 532 // TODO(darin): Bug 1004233. Re-enable this test once all of the chrome | |
| 533 // unit_tests have been fixed to not trip this. | |
| 534 #if 0 | |
| 535 DCHECK(!request_->status().is_io_pending()); | |
| 536 #endif | |
| 537 // The headers should be complete before reads complete | 532 // The headers should be complete before reads complete |
| 538 DCHECK(has_handled_response_); | 533 DCHECK(has_handled_response_); |
| 539 | 534 |
| 540 Error error; | 535 Error error; |
| 541 int bytes_read; | 536 int bytes_read; |
| 542 ConvertResultToError(result, &error, &bytes_read); | 537 ConvertResultToError(result, &error, &bytes_read); |
| 543 | 538 |
| 544 DCHECK_NE(ERR_IO_PENDING, error); | 539 DCHECK_NE(ERR_IO_PENDING, error); |
| 545 | 540 |
| 546 GatherRawReadStats(error, bytes_read); | 541 GatherRawReadStats(error, bytes_read); |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 int64_t total_sent_bytes = GetTotalSentBytes(); | 1003 int64_t total_sent_bytes = GetTotalSentBytes(); |
| 1009 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); | 1004 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); |
| 1010 if (total_sent_bytes > last_notified_total_sent_bytes_) { | 1005 if (total_sent_bytes > last_notified_total_sent_bytes_) { |
| 1011 network_delegate_->NotifyNetworkBytesSent( | 1006 network_delegate_->NotifyNetworkBytesSent( |
| 1012 request_, total_sent_bytes - last_notified_total_sent_bytes_); | 1007 request_, total_sent_bytes - last_notified_total_sent_bytes_); |
| 1013 } | 1008 } |
| 1014 last_notified_total_sent_bytes_ = total_sent_bytes; | 1009 last_notified_total_sent_bytes_ = total_sent_bytes; |
| 1015 } | 1010 } |
| 1016 | 1011 |
| 1017 } // namespace net | 1012 } // namespace net |
| OLD | NEW |