Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: net/test/url_request/url_request_failed_job.cc

Issue 2069303002: Add new Cronet exception class for QUIC errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: header Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/test/url_request/url_request_failed_job.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 if (net_error_ == ERR_QUIC_PROTOCOL_ERROR) {
130 details->quic_connection_error = QUIC_INTERNAL_ERROR;
131 }
132 }
133
127 // static 134 // static
128 void URLRequestFailedJob::AddUrlHandler() { 135 void URLRequestFailedJob::AddUrlHandler() {
129 return AddUrlHandlerForHostname(kMockHostname); 136 return AddUrlHandlerForHostname(kMockHostname);
130 } 137 }
131 138
132 // static 139 // static
133 void URLRequestFailedJob::AddUrlHandlerForHostname( 140 void URLRequestFailedJob::AddUrlHandlerForHostname(
134 const std::string& hostname) { 141 const std::string& hostname) {
135 URLRequestFilter* filter = URLRequestFilter::GetInstance(); 142 URLRequestFilter* filter = URLRequestFilter::GetInstance();
136 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. 143 // Add |hostname| to URLRequestFilter for HTTP and HTTPS.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, net_error_)); 188 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, net_error_));
182 return; 189 return;
183 } 190 }
184 return; 191 return;
185 } 192 }
186 response_info_.headers = new net::HttpResponseHeaders("HTTP/1.1 200 OK"); 193 response_info_.headers = new net::HttpResponseHeaders("HTTP/1.1 200 OK");
187 NotifyHeadersComplete(); 194 NotifyHeadersComplete();
188 } 195 }
189 196
190 } // namespace net 197 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_failed_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698