Chromium Code Reviews| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| 11 #include "base/power_monitor/power_monitor.h" | 11 #include "base/power_monitor/power_monitor.h" |
| 12 #include "base/profiler/scoped_tracker.h" | 12 #include "base/profiler/scoped_tracker.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "net/base/auth.h" | 18 #include "net/base/auth.h" |
| 19 #include "net/base/host_port_pair.h" | 19 #include "net/base/host_port_pair.h" |
| 20 #include "net/base/io_buffer.h" | 20 #include "net/base/io_buffer.h" |
| 21 #include "net/base/load_flags.h" | 21 #include "net/base/load_flags.h" |
| 22 #include "net/base/load_states.h" | 22 #include "net/base/load_states.h" |
| 23 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
| 24 #include "net/base/network_delegate.h" | 24 #include "net/base/network_delegate.h" |
| 25 #include "net/base/network_quality_estimator.h" | 25 #include "net/base/network_quality_estimator.h" |
| 26 #include "net/filter/filter.h" | 26 #include "net/filter/filter.h" |
| 27 #include "net/http/http_response_headers.h" | 27 #include "net/http/http_response_headers.h" |
| 28 #include "net/ssl/ssl_private_key.h" | |
|
davidben
2015/09/25 20:10:12
Nit unnecessary
svaldez
2015/09/28 16:54:53
Done.
| |
| 28 #include "net/url_request/url_request_context.h" | 29 #include "net/url_request/url_request_context.h" |
| 29 | 30 |
| 30 namespace net { | 31 namespace net { |
| 31 | 32 |
| 32 namespace { | 33 namespace { |
| 33 | 34 |
| 34 // Callback for TYPE_URL_REQUEST_FILTERS_SET net-internals event. | 35 // Callback for TYPE_URL_REQUEST_FILTERS_SET net-internals event. |
| 35 scoped_ptr<base::Value> FiltersSetCallback( | 36 scoped_ptr<base::Value> FiltersSetCallback( |
| 36 Filter* filter, | 37 Filter* filter, |
| 37 NetLogCaptureMode /* capture_mode */) { | 38 NetLogCaptureMode /* capture_mode */) { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 // case the derived class should implement this! | 226 // case the derived class should implement this! |
| 226 NOTREACHED(); | 227 NOTREACHED(); |
| 227 } | 228 } |
| 228 | 229 |
| 229 void URLRequestJob::CancelAuth() { | 230 void URLRequestJob::CancelAuth() { |
| 230 // This will only be called if NeedsAuth() returns true, in which | 231 // This will only be called if NeedsAuth() returns true, in which |
| 231 // case the derived class should implement this! | 232 // case the derived class should implement this! |
| 232 NOTREACHED(); | 233 NOTREACHED(); |
| 233 } | 234 } |
| 234 | 235 |
| 235 void URLRequestJob::ContinueWithCertificate( | 236 void URLRequestJob::ContinueWithCertificate(X509Certificate* client_cert, |
| 236 X509Certificate* client_cert) { | 237 SSLPrivateKey* client_pkey) { |
| 237 // The derived class should implement this! | 238 // The derived class should implement this! |
| 238 NOTREACHED(); | 239 NOTREACHED(); |
| 239 } | 240 } |
| 240 | 241 |
| 241 void URLRequestJob::ContinueDespiteLastError() { | 242 void URLRequestJob::ContinueDespiteLastError() { |
| 242 // Implementations should know how to recover from errors they generate. | 243 // Implementations should know how to recover from errors they generate. |
| 243 // If this code was reached, we are trying to recover from an error that | 244 // If this code was reached, we are trying to recover from an error that |
| 244 // we don't know how to recover from. | 245 // we don't know how to recover from. |
| 245 NOTREACHED(); | 246 NOTREACHED(); |
| 246 } | 247 } |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 940 int64_t total_received_bytes = GetTotalReceivedBytes(); | 941 int64_t total_received_bytes = GetTotalReceivedBytes(); |
| 941 DCHECK_GE(total_received_bytes, last_notified_total_received_bytes_); | 942 DCHECK_GE(total_received_bytes, last_notified_total_received_bytes_); |
| 942 if (total_received_bytes > last_notified_total_received_bytes_) { | 943 if (total_received_bytes > last_notified_total_received_bytes_) { |
| 943 network_delegate_->NotifyNetworkBytesReceived( | 944 network_delegate_->NotifyNetworkBytesReceived( |
| 944 *request_, total_received_bytes - last_notified_total_received_bytes_); | 945 *request_, total_received_bytes - last_notified_total_received_bytes_); |
| 945 } | 946 } |
| 946 last_notified_total_received_bytes_ = total_received_bytes; | 947 last_notified_total_received_bytes_ = total_received_bytes; |
| 947 } | 948 } |
| 948 | 949 |
| 949 } // namespace net | 950 } // namespace net |
| OLD | NEW |