diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 18:25:03 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 18:25:03 +0000 |
commit | 7cf4091e5e3eb7b3ee40c8fdc886226100b3a2e7 (patch) | |
tree | 423fdaae7c04f5ea304640618000675feb4e3443 /net/socket/ssl_client_socket.cc | |
parent | 57005ec7bf8cebf0e53a3e59dd9ca062ba1eb053 (diff) | |
download | chromium_src-7cf4091e5e3eb7b3ee40c8fdc886226100b3a2e7.zip chromium_src-7cf4091e5e3eb7b3ee40c8fdc886226100b3a2e7.tar.gz chromium_src-7cf4091e5e3eb7b3ee40c8fdc886226100b3a2e7.tar.bz2 |
Start deinlining non-empty virtual methods. (This will be automatically checked
for in the future.)
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/5574006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68746 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket.cc')
-rw-r--r-- | net/socket/ssl_client_socket.cc | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc new file mode 100644 index 0000000..5635ad5 --- /dev/null +++ b/net/socket/ssl_client_socket.cc @@ -0,0 +1,62 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/socket/ssl_client_socket.h" + +namespace net { + +SSLClientSocket::SSLClientSocket() + : was_npn_negotiated_(false), + was_spdy_negotiated_(false) { +} + +SSLClientSocket::NextProto SSLClientSocket::NextProtoFromString( + const std::string& proto_string) { + if (proto_string == "http1.1" || proto_string == "http/1.1") { + return kProtoHTTP11; + } else if (proto_string == "spdy/1") { + return kProtoSPDY1; + } else if (proto_string == "spdy/2") { + return kProtoSPDY2; + } else { + return kProtoUnknown; + } +} + +bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { + if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) + return true; + + if (error == ERR_CERT_COMMON_NAME_INVALID && + (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) + return true; + + if (error == ERR_CERT_DATE_INVALID && + (load_flags & LOAD_IGNORE_CERT_DATE_INVALID)) + return true; + + if (error == ERR_CERT_AUTHORITY_INVALID && + (load_flags & LOAD_IGNORE_CERT_AUTHORITY_INVALID)) + return true; + + return false; +} + +bool SSLClientSocket::was_npn_negotiated() const { + return was_npn_negotiated_; +} + +bool SSLClientSocket::set_was_npn_negotiated(bool negotiated) { + return was_npn_negotiated_ = negotiated; +} + +bool SSLClientSocket::was_spdy_negotiated() const { + return was_spdy_negotiated_; +} + +bool SSLClientSocket::set_was_spdy_negotiated(bool negotiated) { + return was_spdy_negotiated_ = negotiated; +} + +} // namespace net |