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

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

Issue 2348453002: Remove NPN from SSLConfig and SSLClientSocket*. (Closed)
Patch Set: Re: #7. Created 4 years, 3 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 | « net/socket/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_impl.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/socket/ssl_client_socket.h" 5 #include "net/socket/ssl_client_socket.h"
6 6
7 #include "base/feature_list.h" 7 #include "base/feature_list.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 return "h2"; 50 return "h2";
51 case kProtoQUIC1SPDY3: 51 case kProtoQUIC1SPDY3:
52 return "quic/1+spdy/3"; 52 return "quic/1+spdy/3";
53 case kProtoUnknown: 53 case kProtoUnknown:
54 break; 54 break;
55 } 55 }
56 return "unknown"; 56 return "unknown";
57 } 57 }
58 58
59 // static 59 // static
60 const char* SSLClientSocket::NextProtoStatusToString(
61 const SSLClientSocket::NextProtoStatus status) {
62 switch (status) {
63 case kNextProtoUnsupported:
64 return "unsupported";
65 case kNextProtoNegotiated:
66 return "negotiated";
67 case kNextProtoNoOverlap:
68 return "no-overlap";
69 }
70 return NULL;
71 }
72
73 // static
74 void SSLClientSocket::SetSSLKeyLogFile( 60 void SSLClientSocket::SetSSLKeyLogFile(
75 const base::FilePath& path, 61 const base::FilePath& path,
76 const scoped_refptr<base::SequencedTaskRunner>& task_runner) { 62 const scoped_refptr<base::SequencedTaskRunner>& task_runner) {
77 #if !defined(OS_NACL) 63 #if !defined(OS_NACL)
78 SSLClientSocketImpl::SetSSLKeyLogFile(path, task_runner); 64 SSLClientSocketImpl::SetSSLKeyLogFile(path, task_runner);
79 #else 65 #else
80 NOTIMPLEMENTED(); 66 NOTIMPLEMENTED();
81 #endif 67 #endif
82 } 68 }
83 69
(...skipping 13 matching lines...) Expand all
97 #endif 83 #endif
98 } 84 }
99 85
100 // static 86 // static
101 std::vector<uint8_t> SSLClientSocket::SerializeNextProtos( 87 std::vector<uint8_t> SSLClientSocket::SerializeNextProtos(
102 const NextProtoVector& next_protos) { 88 const NextProtoVector& next_protos) {
103 std::vector<uint8_t> wire_protos; 89 std::vector<uint8_t> wire_protos;
104 for (const NextProto next_proto : next_protos) { 90 for (const NextProto next_proto : next_protos) {
105 const std::string proto = NextProtoToString(next_proto); 91 const std::string proto = NextProtoToString(next_proto);
106 if (proto.size() > 255) { 92 if (proto.size() > 255) {
107 LOG(WARNING) << "Ignoring overlong NPN/ALPN protocol: " << proto; 93 LOG(WARNING) << "Ignoring overlong ALPN protocol: " << proto;
108 continue; 94 continue;
109 } 95 }
110 if (proto.size() == 0) { 96 if (proto.size() == 0) {
111 LOG(WARNING) << "Ignoring empty NPN/ALPN protocol"; 97 LOG(WARNING) << "Ignoring empty ALPN protocol";
112 continue; 98 continue;
113 } 99 }
114 wire_protos.push_back(proto.size()); 100 wire_protos.push_back(proto.size());
115 for (const char ch : proto) { 101 for (const char ch : proto) {
116 wire_protos.push_back(static_cast<uint8_t>(ch)); 102 wire_protos.push_back(static_cast<uint8_t>(ch));
117 } 103 }
118 } 104 }
119 105
120 return wire_protos; 106 return wire_protos;
121 } 107 }
122 108
123 } // namespace net 109 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698