| 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.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "net/base/auth.h" | 12 #include "net/base/auth.h" |
| 13 #include "net/base/host_port_pair.h" | 13 #include "net/base/host_port_pair.h" |
| 14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 15 #include "net/base/load_states.h" | 15 #include "net/base/load_states.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "net/base/network_delegate.h" | 17 #include "net/base/network_delegate.h" |
| 18 #include "net/http/http_response_headers.h" | 18 #include "net/http/http_response_headers.h" |
| 19 #include "net/url_request/url_request.h" | 19 #include "net/url_request/url_request.h" |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 | 22 |
| 23 URLRequestJob::URLRequestJob(URLRequest* request, | 23 URLRequestJob::URLRequestJob(URLRequest* request, |
| 24 NetworkDelegate* network_delegate) | 24 NetworkDelegate* network_delegate) |
| 25 : request_(request), | 25 : request_(request), |
| 26 network_delegate_(network_delegate), |
| 26 done_(false), | 27 done_(false), |
| 27 prefilter_bytes_read_(0), | 28 prefilter_bytes_read_(0), |
| 28 postfilter_bytes_read_(0), | 29 postfilter_bytes_read_(0), |
| 29 filter_input_byte_count_(0), | 30 filter_input_byte_count_(0), |
| 30 filter_needs_more_output_space_(false), | 31 filter_needs_more_output_space_(false), |
| 31 filtered_read_buffer_len_(0), | 32 filtered_read_buffer_len_(0), |
| 32 has_handled_response_(false), | 33 has_handled_response_(false), |
| 33 expected_content_size_(-1), | 34 expected_content_size_(-1), |
| 34 deferred_redirect_status_code_(-1), | 35 deferred_redirect_status_code_(-1), |
| 35 network_delegate_(network_delegate), | |
| 36 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 36 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
| 37 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); | 37 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); |
| 38 if (system_monitor) | 38 if (system_monitor) |
| 39 base::SystemMonitor::Get()->AddPowerObserver(this); | 39 base::SystemMonitor::Get()->AddPowerObserver(this); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void URLRequestJob::SetUpload(UploadDataStream* upload) { | 42 void URLRequestJob::SetUpload(UploadDataStream* upload) { |
| 43 } | 43 } |
| 44 | 44 |
| 45 void URLRequestJob::SetExtraRequestHeaders(const HttpRequestHeaders& headers) { | 45 void URLRequestJob::SetExtraRequestHeaders(const HttpRequestHeaders& headers) { |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 } | 709 } |
| 710 | 710 |
| 711 bool URLRequestJob::FilterHasData() { | 711 bool URLRequestJob::FilterHasData() { |
| 712 return filter_.get() && filter_->stream_data_len(); | 712 return filter_.get() && filter_->stream_data_len(); |
| 713 } | 713 } |
| 714 | 714 |
| 715 void URLRequestJob::UpdatePacketReadTimes() { | 715 void URLRequestJob::UpdatePacketReadTimes() { |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace net | 718 } // namespace net |
| OLD | NEW |