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

Side by Side Diff: net/http/http_stream_factory_impl.cc

Issue 995013004: Add IsAlternativeServiceBroken(), remove is_broken. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More nits. Created 5 years, 9 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
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/http/http_stream_factory_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 return kNoAlternateProtocol; 183 return kNoAlternateProtocol;
184 184
185 HostPortPair origin = HostPortPair::FromURL(original_url); 185 HostPortPair origin = HostPortPair::FromURL(original_url);
186 HttpServerProperties& http_server_properties = 186 HttpServerProperties& http_server_properties =
187 *session_->http_server_properties(); 187 *session_->http_server_properties();
188 const AlternateProtocolInfo alternate = 188 const AlternateProtocolInfo alternate =
189 http_server_properties.GetAlternateProtocol(origin); 189 http_server_properties.GetAlternateProtocol(origin);
190 190
191 if (alternate.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) 191 if (alternate.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL)
192 return kNoAlternateProtocol; 192 return kNoAlternateProtocol;
193 if (alternate.is_broken) { 193 const AlternativeService alternative_service(alternate.protocol,
194 origin.host(), alternate.port);
195 if (http_server_properties.IsAlternativeServiceBroken(alternative_service)) {
194 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN); 196 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN);
195 return kNoAlternateProtocol; 197 return kNoAlternateProtocol;
196 } 198 }
197 if (!IsAlternateProtocolValid(alternate.protocol)) { 199 if (!IsAlternateProtocolValid(alternate.protocol)) {
198 NOTREACHED(); 200 NOTREACHED();
199 return kNoAlternateProtocol; 201 return kNoAlternateProtocol;
200 } 202 }
201 203
202 // Some shared unix systems may have user home directories (like 204 // Some shared unix systems may have user home directories (like
203 // http://foo.com/~mike) which allow users to emit headers. This is a bad 205 // http://foo.com/~mike) which allow users to emit headers. This is a bad
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 delete job; 296 delete job;
295 } 297 }
296 298
297 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { 299 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) {
298 preconnect_job_set_.erase(job); 300 preconnect_job_set_.erase(job);
299 delete job; 301 delete job;
300 OnPreconnectsCompleteInternal(); 302 OnPreconnectsCompleteInternal();
301 } 303 }
302 304
303 } // namespace net 305 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698