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

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

Issue 794563003: Change next_proto member type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit in comment. Created 6 years 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/http/http_network_session.h ('k') | net/socket/next_proto.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_session.h" 5 #include "net/http/http_network_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/debug/stack_trace.h" 10 #include "base/debug/stack_trace.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 // TODO(rtenneti): bug 116575 - consider combining the NextProto and 160 // TODO(rtenneti): bug 116575 - consider combining the NextProto and
161 // AlternateProtocol. 161 // AlternateProtocol.
162 for (std::vector<NextProto>::const_iterator it = params_.next_protos.begin(); 162 for (std::vector<NextProto>::const_iterator it = params_.next_protos.begin();
163 it != params_.next_protos.end(); ++it) { 163 it != params_.next_protos.end(); ++it) {
164 NextProto proto = *it; 164 NextProto proto = *it;
165 165
166 // Add the protocol to the TLS next protocol list, except for QUIC 166 // Add the protocol to the TLS next protocol list, except for QUIC
167 // since it uses UDP. 167 // since it uses UDP.
168 if (proto != kProtoQUIC1SPDY3) { 168 if (proto != kProtoQUIC1SPDY3) {
169 next_protos_.push_back(SSLClientSocket::NextProtoToString(proto)); 169 next_protos_.push_back(proto);
170 } 170 }
171 171
172 // Enable the corresponding alternate protocol, except for HTTP 172 // Enable the corresponding alternate protocol, except for HTTP
173 // which has not corresponding alternative. 173 // which has not corresponding alternative.
174 if (proto != kProtoHTTP11) { 174 if (proto != kProtoHTTP11) {
175 AlternateProtocol alternate = AlternateProtocolFromNextProto(proto); 175 AlternateProtocol alternate = AlternateProtocolFromNextProto(proto);
176 if (!IsAlternateProtocolValid(alternate)) { 176 if (!IsAlternateProtocolValid(alternate)) {
177 NOTREACHED() << "Invalid next proto: " << proto; 177 NOTREACHED() << "Invalid next proto: " << proto;
178 continue; 178 continue;
179 } 179 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 websocket_socket_pool_manager_->CloseIdleSockets(); 277 websocket_socket_pool_manager_->CloseIdleSockets();
278 spdy_session_pool_.CloseCurrentIdleSessions(); 278 spdy_session_pool_.CloseCurrentIdleSessions();
279 } 279 }
280 280
281 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { 281 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const {
282 DCHECK(IsAlternateProtocolValid(protocol)); 282 DCHECK(IsAlternateProtocolValid(protocol));
283 return enabled_protocols_[ 283 return enabled_protocols_[
284 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION]; 284 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION];
285 } 285 }
286 286
287 void HttpNetworkSession::GetNextProtos( 287 void HttpNetworkSession::GetNextProtos(NextProtoVector* next_protos) const {
288 std::vector<std::string>* next_protos) const {
289 if (HttpStreamFactory::spdy_enabled()) { 288 if (HttpStreamFactory::spdy_enabled()) {
290 *next_protos = next_protos_; 289 *next_protos = next_protos_;
291 } else { 290 } else {
292 next_protos->clear(); 291 next_protos->clear();
293 } 292 }
294 } 293 }
295 294
296 bool HttpNetworkSession::HasSpdyExclusion( 295 bool HttpNetworkSession::HasSpdyExclusion(
297 HostPortPair host_port_pair) const { 296 HostPortPair host_port_pair) const {
298 return params_.forced_spdy_exclusions.find(host_port_pair) != 297 return params_.forced_spdy_exclusions.find(host_port_pair) !=
299 params_.forced_spdy_exclusions.end(); 298 params_.forced_spdy_exclusions.end();
300 } 299 }
301 300
302 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( 301 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager(
303 SocketPoolType pool_type) { 302 SocketPoolType pool_type) {
304 switch (pool_type) { 303 switch (pool_type) {
305 case NORMAL_SOCKET_POOL: 304 case NORMAL_SOCKET_POOL:
306 return normal_socket_pool_manager_.get(); 305 return normal_socket_pool_manager_.get();
307 case WEBSOCKET_SOCKET_POOL: 306 case WEBSOCKET_SOCKET_POOL:
308 return websocket_socket_pool_manager_.get(); 307 return websocket_socket_pool_manager_.get();
309 default: 308 default:
310 NOTREACHED(); 309 NOTREACHED();
311 break; 310 break;
312 } 311 }
313 return NULL; 312 return NULL;
314 } 313 }
315 314
316 } // namespace net 315 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_session.h ('k') | net/socket/next_proto.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698