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

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

Issue 9959033: Move NextProto enum to a new file net/socket/next_proto.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address wtc's comments Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_network_transaction_spdy21_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_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_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 it != spdy_options.end(); ++it) { 70 it != spdy_options.end(); ++it) {
71 const std::string& element = *it; 71 const std::string& element = *it;
72 std::vector<std::string> name_value; 72 std::vector<std::string> name_value;
73 base::SplitString(element, '=', &name_value); 73 base::SplitString(element, '=', &name_value);
74 const std::string& option = name_value[0]; 74 const std::string& option = name_value[0];
75 const std::string value = name_value.size() > 1 ? name_value[1] : ""; 75 const std::string value = name_value.size() > 1 ? name_value[1] : "";
76 76
77 if (option == kOff) { 77 if (option == kOff) {
78 HttpStreamFactory::set_spdy_enabled(false); 78 HttpStreamFactory::set_spdy_enabled(false);
79 } else if (option == kDisableSSL) { 79 } else if (option == kDisableSSL) {
80 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY2); 80 SpdySession::set_default_protocol(kProtoSPDY2);
81 HttpStreamFactory::set_force_spdy_over_ssl(false); 81 HttpStreamFactory::set_force_spdy_over_ssl(false);
82 HttpStreamFactory::set_force_spdy_always(true); 82 HttpStreamFactory::set_force_spdy_always(true);
83 } else if (option == kSSL) { 83 } else if (option == kSSL) {
84 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY2); 84 SpdySession::set_default_protocol(kProtoSPDY2);
85 HttpStreamFactory::set_force_spdy_over_ssl(true); 85 HttpStreamFactory::set_force_spdy_over_ssl(true);
86 HttpStreamFactory::set_force_spdy_always(true); 86 HttpStreamFactory::set_force_spdy_always(true);
87 } else if (option == kDisablePing) { 87 } else if (option == kDisablePing) {
88 SpdySession::set_enable_ping_based_connection_checking(false); 88 SpdySession::set_enable_ping_based_connection_checking(false);
89 } else if (option == kExclude) { 89 } else if (option == kExclude) {
90 HttpStreamFactory::add_forced_spdy_exclusion(value); 90 HttpStreamFactory::add_forced_spdy_exclusion(value);
91 } else if (option == kDisableCompression) { 91 } else if (option == kDisableCompression) {
92 SpdyFramer::set_enable_compression_default(false); 92 SpdyFramer::set_enable_compression_default(false);
93 } else if (option == kEnableNPN) { 93 } else if (option == kEnableNPN) {
94 HttpStreamFactory::set_use_alternate_protocols(use_alt_protocols); 94 HttpStreamFactory::set_use_alternate_protocols(use_alt_protocols);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 if (session_) 151 if (session_)
152 session_->CloseIdleConnections(); 152 session_->CloseIdleConnections();
153 } 153 }
154 154
155 void HttpNetworkLayer::OnResume() { 155 void HttpNetworkLayer::OnResume() {
156 suspended_ = false; 156 suspended_ = false;
157 } 157 }
158 158
159 } // namespace net 159 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction_spdy21_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698