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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/power_monitor/power_monitor.h" | 10 #include "base/power_monitor/power_monitor.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 392 |
393 request_->NotifyResponseStarted(); | 393 request_->NotifyResponseStarted(); |
394 } | 394 } |
395 | 395 |
396 void URLRequestJob::NotifyReadComplete(int bytes_read) { | 396 void URLRequestJob::NotifyReadComplete(int bytes_read) { |
397 if (!request_ || !request_->has_delegate()) | 397 if (!request_ || !request_->has_delegate()) |
398 return; // The request was destroyed, so there is no more work to do. | 398 return; // The request was destroyed, so there is no more work to do. |
399 | 399 |
400 // TODO(darin): Bug 1004233. Re-enable this test once all of the chrome | 400 // TODO(darin): Bug 1004233. Re-enable this test once all of the chrome |
401 // unit_tests have been fixed to not trip this. | 401 // unit_tests have been fixed to not trip this. |
402 //DCHECK(!request_->status().is_io_pending()); | 402 #if 0 |
403 | 403 DCHECK(!request_->status().is_io_pending()); |
| 404 #endif |
404 // The headers should be complete before reads complete | 405 // The headers should be complete before reads complete |
405 DCHECK(has_handled_response_); | 406 DCHECK(has_handled_response_); |
406 | 407 |
407 OnRawReadComplete(bytes_read); | 408 OnRawReadComplete(bytes_read); |
408 | 409 |
409 // Don't notify if we had an error. | 410 // Don't notify if we had an error. |
410 if (!request_->status().is_success()) | 411 if (!request_->status().is_success()) |
411 return; | 412 return; |
412 | 413 |
413 // When notifying the delegate, the delegate can release the request | 414 // When notifying the delegate, the delegate can release the request |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 } | 760 } |
760 | 761 |
761 bool URLRequestJob::FilterHasData() { | 762 bool URLRequestJob::FilterHasData() { |
762 return filter_.get() && filter_->stream_data_len(); | 763 return filter_.get() && filter_->stream_data_len(); |
763 } | 764 } |
764 | 765 |
765 void URLRequestJob::UpdatePacketReadTimes() { | 766 void URLRequestJob::UpdatePacketReadTimes() { |
766 } | 767 } |
767 | 768 |
768 } // namespace net | 769 } // namespace net |
OLD | NEW |