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

Side by Side Diff: net/socket/ssl_client_socket.cc

Issue 25956002: [SPDY] Remove references to obsolete SPDY versions SPDY/1 and SPDY/2.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 7 years, 2 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 | « net/socket/next_proto.h ('k') | net/spdy/buffered_spdy_framer.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/socket/ssl_client_socket.h" 5 #include "net/socket/ssl_client_socket.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 SSLClientSocket::SSLClientSocket() 11 SSLClientSocket::SSLClientSocket()
12 : was_npn_negotiated_(false), 12 : was_npn_negotiated_(false),
13 was_spdy_negotiated_(false), 13 was_spdy_negotiated_(false),
14 protocol_negotiated_(kProtoUnknown), 14 protocol_negotiated_(kProtoUnknown),
15 channel_id_sent_(false) { 15 channel_id_sent_(false) {
16 } 16 }
17 17
18 // static 18 // static
19 NextProto SSLClientSocket::NextProtoFromString( 19 NextProto SSLClientSocket::NextProtoFromString(
20 const std::string& proto_string) { 20 const std::string& proto_string) {
21 if (proto_string == "http1.1" || proto_string == "http/1.1") { 21 if (proto_string == "http1.1" || proto_string == "http/1.1") {
22 return kProtoHTTP11; 22 return kProtoHTTP11;
23 } else if (proto_string == "spdy/1") {
24 return kProtoSPDY1;
25 } else if (proto_string == "spdy/2") { 23 } else if (proto_string == "spdy/2") {
26 return kProtoSPDY2; 24 return kProtoSPDY2;
27 } else if (proto_string == "spdy/3") { 25 } else if (proto_string == "spdy/3") {
28 return kProtoSPDY3; 26 return kProtoSPDY3;
29 } else if (proto_string == "spdy/3.1") { 27 } else if (proto_string == "spdy/3.1") {
30 return kProtoSPDY31; 28 return kProtoSPDY31;
31 } else if (proto_string == "spdy/4a2") { 29 } else if (proto_string == "spdy/4a2") {
32 return kProtoSPDY4a2; 30 return kProtoSPDY4a2;
33 } else if (proto_string == "HTTP-draft-04/2.0") { 31 } else if (proto_string == "HTTP-draft-04/2.0") {
34 return kProtoHTTP2Draft04; 32 return kProtoHTTP2Draft04;
35 } else if (proto_string == "quic/1+spdy/3") { 33 } else if (proto_string == "quic/1+spdy/3") {
36 return kProtoQUIC1SPDY3; 34 return kProtoQUIC1SPDY3;
37 } else { 35 } else {
38 return kProtoUnknown; 36 return kProtoUnknown;
39 } 37 }
40 } 38 }
41 39
42 // static 40 // static
43 const char* SSLClientSocket::NextProtoToString(NextProto next_proto) { 41 const char* SSLClientSocket::NextProtoToString(NextProto next_proto) {
44 switch (next_proto) { 42 switch (next_proto) {
45 case kProtoHTTP11: 43 case kProtoHTTP11:
46 return "http/1.1"; 44 return "http/1.1";
47 case kProtoSPDY1:
48 return "spdy/1";
49 case kProtoSPDY2: 45 case kProtoSPDY2:
50 return "spdy/2"; 46 return "spdy/2";
51 case kProtoSPDY3: 47 case kProtoSPDY3:
52 return "spdy/3"; 48 return "spdy/3";
53 case kProtoSPDY31: 49 case kProtoSPDY31:
54 return "spdy/3.1"; 50 return "spdy/3.1";
55 case kProtoSPDY4a2: 51 case kProtoSPDY4a2:
56 return "spdy/4a2"; 52 return "spdy/4a2";
57 case kProtoHTTP2Draft04: 53 case kProtoHTTP2Draft04:
58 return "HTTP-draft-04/2.0"; 54 return "HTTP-draft-04/2.0";
59 case kProtoQUIC1SPDY3: 55 case kProtoQUIC1SPDY3:
60 return "quic/1+spdy/3"; 56 return "quic/1+spdy/3";
61 case kProtoSPDY21:
62 case kProtoUnknown: 57 case kProtoUnknown:
63 break; 58 break;
64 } 59 }
65 return "unknown"; 60 return "unknown";
66 } 61 }
67 62
68 // static 63 // static
69 const char* SSLClientSocket::NextProtoStatusToString( 64 const char* SSLClientSocket::NextProtoStatusToString(
70 const SSLClientSocket::NextProtoStatus status) { 65 const SSLClientSocket::NextProtoStatus status) {
71 switch (status) { 66 switch (status) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 134
140 bool SSLClientSocket::WasChannelIDSent() const { 135 bool SSLClientSocket::WasChannelIDSent() const {
141 return channel_id_sent_; 136 return channel_id_sent_;
142 } 137 }
143 138
144 void SSLClientSocket::set_channel_id_sent(bool channel_id_sent) { 139 void SSLClientSocket::set_channel_id_sent(bool channel_id_sent) {
145 channel_id_sent_ = channel_id_sent; 140 channel_id_sent_ = channel_id_sent;
146 } 141 }
147 142
148 } // namespace net 143 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/next_proto.h ('k') | net/spdy/buffered_spdy_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698