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

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

Issue 476313004: Change the lifespan of SSlConnectJobMessengers so that they are created (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mark the SSLConnectJobMessenger constructor as explicit Created 6 years, 4 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/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_nss.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/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "crypto/ec_private_key.h" 9 #include "crypto/ec_private_key.h"
10 #include "net/base/host_port_pair.h" 10 #include "net/base/host_port_pair.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 bool SSLClientSocket::WasNpnNegotiated() const { 84 bool SSLClientSocket::WasNpnNegotiated() const {
85 return was_npn_negotiated_; 85 return was_npn_negotiated_;
86 } 86 }
87 87
88 NextProto SSLClientSocket::GetNegotiatedProtocol() const { 88 NextProto SSLClientSocket::GetNegotiatedProtocol() const {
89 return protocol_negotiated_; 89 return protocol_negotiated_;
90 } 90 }
91 91
92 // static
93 std::string SSLClientSocket::CreateSessionCacheKey(
94 const HostPortPair& host_and_port,
95 const std::string& ssl_session_cache_shard) {
96 std::string result = host_and_port.ToString();
97 result.append("/");
98 result.append(ssl_session_cache_shard);
99 return result;
100 }
101
102 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { 92 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) {
103 if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) 93 if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS)
104 return true; 94 return true;
105 95
106 if (error == ERR_CERT_COMMON_NAME_INVALID && 96 if (error == ERR_CERT_COMMON_NAME_INVALID &&
107 (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) 97 (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID))
108 return true; 98 return true;
109 99
110 if (error == ERR_CERT_DATE_INVALID && 100 if (error == ERR_CERT_DATE_INVALID &&
111 (load_flags & LOAD_IGNORE_CERT_DATE_INVALID)) 101 (load_flags & LOAD_IGNORE_CERT_DATE_INVALID))
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 wire_protos.resize(wire_protos.size() + i->size()); 226 wire_protos.resize(wire_protos.size() + i->size());
237 memcpy(&wire_protos[wire_protos.size() - i->size()], 227 memcpy(&wire_protos[wire_protos.size() - i->size()],
238 i->data(), i->size()); 228 i->data(), i->size());
239 } 229 }
240 DCHECK_EQ(wire_protos.size(), wire_length); 230 DCHECK_EQ(wire_protos.size(), wire_length);
241 231
242 return wire_protos; 232 return wire_protos;
243 } 233 }
244 234
245 } // namespace net 235 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_nss.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698