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

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

Issue 2140733002: Remove HttpStreamFactory::spdy_enabled_ static member and accessors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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
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/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 spdy_session_pool_.CloseCurrentIdleSessions(); 359 spdy_session_pool_.CloseCurrentIdleSessions();
360 } 360 }
361 361
362 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { 362 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const {
363 DCHECK(IsAlternateProtocolValid(protocol)); 363 DCHECK(IsAlternateProtocolValid(protocol));
364 return enabled_protocols_[ 364 return enabled_protocols_[
365 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION]; 365 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION];
366 } 366 }
367 367
368 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { 368 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const {
369 if (HttpStreamFactory::spdy_enabled()) { 369 *alpn_protos = next_protos_;
370 *alpn_protos = next_protos_;
371 } else {
372 // HttpStreamFactory::spdy_enabled() only affects SPDY/3.1,
373 // but not other ALPN protocols.
374 alpn_protos->clear();
375 for (auto proto : next_protos_) {
376 if (proto != kProtoSPDY31)
377 alpn_protos->push_back(proto);
378 }
379 }
380 } 370 }
381 371
382 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const { 372 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const {
383 npn_protos->clear(); 373 npn_protos->clear();
384 } 374 }
385 375
386 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, 376 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request,
387 SSLConfig* server_config, 377 SSLConfig* server_config,
388 SSLConfig* proxy_config) const { 378 SSLConfig* proxy_config) const {
389 ssl_config_service_->GetSSLConfig(server_config); 379 ssl_config_service_->GetSSLConfig(server_config);
(...skipping 27 matching lines...) Expand all
417 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: 407 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE:
418 break; 408 break;
419 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: 409 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
420 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: 410 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
421 CloseIdleConnections(); 411 CloseIdleConnections();
422 break; 412 break;
423 } 413 }
424 } 414 }
425 415
426 } // namespace net 416 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698