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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 void URLRequestJob::DoneReadingRedirectResponse() { | 524 void URLRequestJob::DoneReadingRedirectResponse() { |
525 } | 525 } |
526 | 526 |
527 void URLRequestJob::FilteredDataRead(int bytes_read) { | 527 void URLRequestJob::FilteredDataRead(int bytes_read) { |
528 DCHECK(filter_); | 528 DCHECK(filter_); |
529 filter_->FlushStreamBuffer(bytes_read); | 529 filter_->FlushStreamBuffer(bytes_read); |
530 } | 530 } |
531 | 531 |
532 bool URLRequestJob::ReadFilteredData(int* bytes_read) { | 532 bool URLRequestJob::ReadFilteredData(int* bytes_read) { |
533 DCHECK(filter_); | 533 DCHECK(filter_); |
534 DCHECK(filtered_read_buffer_); | 534 DCHECK(filtered_read_buffer_.get()); |
535 DCHECK_GT(filtered_read_buffer_len_, 0); | 535 DCHECK_GT(filtered_read_buffer_len_, 0); |
536 DCHECK_LT(filtered_read_buffer_len_, 1000000); // Sanity check. | 536 DCHECK_LT(filtered_read_buffer_len_, 1000000); // Sanity check. |
537 DCHECK(!raw_read_buffer_); | 537 DCHECK(!raw_read_buffer_.get()); |
538 | 538 |
539 *bytes_read = 0; | 539 *bytes_read = 0; |
540 bool rv = false; | 540 bool rv = false; |
541 | 541 |
542 for (;;) { | 542 for (;;) { |
543 if (is_done()) | 543 if (is_done()) |
544 return true; | 544 return true; |
545 | 545 |
546 if (!filter_needs_more_output_space_ && !filter_->stream_data_len()) { | 546 if (!filter_needs_more_output_space_ && !filter_->stream_data_len()) { |
547 // We don't have any raw data to work with, so read from the transaction. | 547 // We don't have any raw data to work with, so read from the transaction. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 !redirect_info.new_url.SchemeIsSecure()) { | 795 !redirect_info.new_url.SchemeIsSecure()) { |
796 redirect_info.new_referrer.clear(); | 796 redirect_info.new_referrer.clear(); |
797 } else { | 797 } else { |
798 redirect_info.new_referrer = request_->referrer(); | 798 redirect_info.new_referrer = request_->referrer(); |
799 } | 799 } |
800 | 800 |
801 return redirect_info; | 801 return redirect_info; |
802 } | 802 } |
803 | 803 |
804 } // namespace net | 804 } // namespace net |
OLD | NEW |