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

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

Issue 1575048: SPDY: Change Chrome code to support new NPN protocols. (Closed)
Patch Set: oops Created 10 years, 8 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.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_layer.h" 5 #include "net/http/http_network_layer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "net/http/http_network_session.h" 9 #include "net/http/http_network_session.h"
10 #include "net/http/http_network_transaction.h" 10 #include "net/http/http_network_transaction.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 for (std::vector<std::string>::iterator it = spdy_options.begin(); 129 for (std::vector<std::string>::iterator it = spdy_options.begin();
130 it != spdy_options.end(); ++it) { 130 it != spdy_options.end(); ++it) {
131 const std::string& option = *it; 131 const std::string& option = *it;
132 132
133 // Disable SSL 133 // Disable SSL
134 if (option == kDisableSSL) { 134 if (option == kDisableSSL) {
135 SpdySession::SetSSLMode(false); 135 SpdySession::SetSSLMode(false);
136 } else if (option == kDisableCompression) { 136 } else if (option == kDisableCompression) {
137 spdy::SpdyFramer::set_enable_compression_default(false); 137 spdy::SpdyFramer::set_enable_compression_default(false);
138 } else if (option == kEnableNPN) { 138 } else if (option == kEnableNPN) {
139 HttpNetworkTransaction::SetNextProtos("\007http1.1\004spdy"); 139 // Except for the first element, the order is irrelevant. First element
140 // specifies the fallback in case nothing matches
141 // (SSLClientSocket::kNextProtoNoOverlap). Otherwise, the SSL library
142 // will choose the first overlapping protocol in the server's list, since
143 // it presumedly has a better understanding of which protocol we should
144 // use, therefore the rest of the ordering here is not important.
145 HttpNetworkTransaction::SetNextProtos(
146 "\008http/1.1\007http1.1\006spdy/1\004spdy");
140 force_spdy_ = false; 147 force_spdy_ = false;
141 } else if (option.empty() && it == spdy_options.begin()) { 148 } else if (option.empty() && it == spdy_options.begin()) {
142 continue; 149 continue;
143 } else { 150 } else {
144 LOG(DFATAL) << "Unrecognized spdy option: " << option; 151 LOG(DFATAL) << "Unrecognized spdy option: " << option;
145 } 152 }
146 } 153 }
147 } 154 }
148 155
149 } // namespace net 156 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698