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

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

Issue 1310583002: Change |use_alternative_service| not to disable Alternate Protocols. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests. Created 5 years, 3 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 | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | 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/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "url/gurl.h" 63 #include "url/gurl.h"
64 #include "url/url_canon.h" 64 #include "url/url_canon.h"
65 65
66 namespace net { 66 namespace net {
67 67
68 namespace { 68 namespace {
69 69
70 void ProcessAlternativeServices(HttpNetworkSession* session, 70 void ProcessAlternativeServices(HttpNetworkSession* session,
71 const HttpResponseHeaders& headers, 71 const HttpResponseHeaders& headers,
72 const HostPortPair& http_host_port_pair) { 72 const HostPortPair& http_host_port_pair) {
73 if (headers.HasHeader(kAlternativeServiceHeader)) { 73 if (session->params().use_alternative_services &&
74 headers.HasHeader(kAlternativeServiceHeader)) {
74 std::string alternative_service_str; 75 std::string alternative_service_str;
75 headers.GetNormalizedHeader(kAlternativeServiceHeader, 76 headers.GetNormalizedHeader(kAlternativeServiceHeader,
76 &alternative_service_str); 77 &alternative_service_str);
77 session->http_stream_factory()->ProcessAlternativeService( 78 session->http_stream_factory()->ProcessAlternativeService(
78 session->http_server_properties(), alternative_service_str, 79 session->http_server_properties(), alternative_service_str,
79 http_host_port_pair, *session); 80 http_host_port_pair, *session);
80 // If there is an "Alt-Svc" header, then ignore "Alternate-Protocol". 81 // If there is an "Alt-Svc" header, then ignore "Alternate-Protocol".
81 return; 82 return;
82 } 83 }
83 84
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 DCHECK(stream_request_); 1660 DCHECK(stream_request_);
1660 1661
1661 // Since the transaction can restart with auth credentials, it may create a 1662 // Since the transaction can restart with auth credentials, it may create a
1662 // stream more than once. Accumulate all of the connection attempts across 1663 // stream more than once. Accumulate all of the connection attempts across
1663 // those streams by appending them to the vector: 1664 // those streams by appending them to the vector:
1664 for (const auto& attempt : stream_request_->connection_attempts()) 1665 for (const auto& attempt : stream_request_->connection_attempts())
1665 connection_attempts_.push_back(attempt); 1666 connection_attempts_.push_back(attempt);
1666 } 1667 }
1667 1668
1668 } // namespace net 1669 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698