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/test/url_request/url_request_failed_job.h" | 5 #include "net/test/url_request/url_request_failed_job.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 // If we have headers, get the response code from them. | 117 // If we have headers, get the response code from them. |
| 118 if (response_info_.headers) | 118 if (response_info_.headers) |
| 119 return response_info_.headers->response_code(); | 119 return response_info_.headers->response_code(); |
| 120 return URLRequestJob::GetResponseCode(); | 120 return URLRequestJob::GetResponseCode(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void URLRequestFailedJob::GetResponseInfo(HttpResponseInfo* info) { | 123 void URLRequestFailedJob::GetResponseInfo(HttpResponseInfo* info) { |
| 124 *info = response_info_; | 124 *info = response_info_; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void URLRequestFailedJob::PopulateNetErrorDetails( | |
| 128 NetErrorDetails* details) const { | |
| 129 details->quic_connection_error = QUIC_INTERNAL_ERROR; | |
|
pauljensen
2016/06/17 12:05:59
I don't think we should set |quic_connection_error
mgersh
2016/06/29 23:01:09
Done.
| |
| 130 } | |
| 131 | |
| 127 // static | 132 // static |
| 128 void URLRequestFailedJob::AddUrlHandler() { | 133 void URLRequestFailedJob::AddUrlHandler() { |
| 129 return AddUrlHandlerForHostname(kMockHostname); | 134 return AddUrlHandlerForHostname(kMockHostname); |
| 130 } | 135 } |
| 131 | 136 |
| 132 // static | 137 // static |
| 133 void URLRequestFailedJob::AddUrlHandlerForHostname( | 138 void URLRequestFailedJob::AddUrlHandlerForHostname( |
| 134 const std::string& hostname) { | 139 const std::string& hostname) { |
| 135 URLRequestFilter* filter = URLRequestFilter::GetInstance(); | 140 URLRequestFilter* filter = URLRequestFilter::GetInstance(); |
| 136 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. | 141 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, net_error_)); | 186 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, net_error_)); |
| 182 return; | 187 return; |
| 183 } | 188 } |
| 184 return; | 189 return; |
| 185 } | 190 } |
| 186 response_info_.headers = new net::HttpResponseHeaders("HTTP/1.1 200 OK"); | 191 response_info_.headers = new net::HttpResponseHeaders("HTTP/1.1 200 OK"); |
| 187 NotifyHeadersComplete(); | 192 NotifyHeadersComplete(); |
| 188 } | 193 } |
| 189 | 194 |
| 190 } // namespace net | 195 } // namespace net |
| OLD | NEW |