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

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
« no previous file with comments | « components/policy/resources/policy_templates.json ('k') | net/http/http_stream_factory.h » ('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/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 spdy_session_pool_.CloseCurrentIdleSessions(); 357 spdy_session_pool_.CloseCurrentIdleSessions();
358 } 358 }
359 359
360 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { 360 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const {
361 DCHECK(IsAlternateProtocolValid(protocol)); 361 DCHECK(IsAlternateProtocolValid(protocol));
362 return enabled_protocols_[ 362 return enabled_protocols_[
363 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION]; 363 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION];
364 } 364 }
365 365
366 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { 366 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const {
367 if (HttpStreamFactory::spdy_enabled()) { 367 *alpn_protos = next_protos_;
368 *alpn_protos = next_protos_;
369 } else {
370 // HttpStreamFactory::spdy_enabled() only affects SPDY/3.1,
371 // but not other ALPN protocols.
372 alpn_protos->clear();
373 for (auto proto : next_protos_) {
374 if (proto != kProtoSPDY31)
375 alpn_protos->push_back(proto);
376 }
377 }
378 } 368 }
379 369
380 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const { 370 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const {
381 npn_protos->clear(); 371 npn_protos->clear();
382 } 372 }
383 373
384 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, 374 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request,
385 SSLConfig* server_config, 375 SSLConfig* server_config,
386 SSLConfig* proxy_config) const { 376 SSLConfig* proxy_config) const {
387 ssl_config_service_->GetSSLConfig(server_config); 377 ssl_config_service_->GetSSLConfig(server_config);
(...skipping 27 matching lines...) Expand all
415 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: 405 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE:
416 break; 406 break;
417 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: 407 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
418 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: 408 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
419 CloseIdleConnections(); 409 CloseIdleConnections();
420 break; 410 break;
421 } 411 }
422 } 412 }
423 413
424 } // namespace net 414 } // namespace net
OLDNEW
« no previous file with comments | « components/policy/resources/policy_templates.json ('k') | net/http/http_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698