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

Unified Diff: net/socket/socket_test_util.cc

Issue 1097773003: Clean up NPN/ALPN-related SSLClientSocket bits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rsleevi comment Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/ssl_client_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index b905597a2aa2d5d079586126684c6adbf53d19a3..1da73346eddba26e5926a678f69bf0083027adb6 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -273,8 +273,6 @@ void DynamicSocketDataProvider::SimulateRead(const char* data,
SSLSocketDataProvider::SSLSocketDataProvider(IoMode mode, int result)
: connect(mode, result),
next_proto_status(SSLClientSocket::kNextProtoUnsupported),
- was_npn_negotiated(false),
- protocol_negotiated(kProtoUnknown),
client_cert_sent(false),
cert_request_info(NULL),
channel_id_sent(false),
@@ -289,9 +287,7 @@ SSLSocketDataProvider::~SSLSocketDataProvider() {
}
void SSLSocketDataProvider::SetNextProto(NextProto proto) {
- was_npn_negotiated = true;
next_proto_status = SSLClientSocket::kNextProtoNegotiated;
- protocol_negotiated = proto;
next_proto = SSLClientSocket::NextProtoToString(proto);
}
@@ -784,8 +780,8 @@ ChannelIDService* MockClientSocket::GetChannelIDService() const {
return NULL;
}
-SSLClientSocket::NextProtoStatus
-MockClientSocket::GetNextProto(std::string* proto) {
+SSLClientSocket::NextProtoStatus MockClientSocket::GetNextProto(
+ std::string* proto) const {
proto->clear();
return SSLClientSocket::kNextProtoUnsupported;
}
@@ -1319,11 +1315,7 @@ MockSSLClientSocket::MockSSLClientSocket(
// tests.
transport_socket->socket()->NetLog()),
transport_(transport_socket.Pass()),
- data_(data),
- is_npn_state_set_(false),
- new_npn_value_(false),
- is_protocol_negotiated_set_(false),
- protocol_negotiated_(kProtoUnknown) {
+ data_(data) {
DCHECK(data_);
peer_addr_ = data->connect.peer_addr;
}
@@ -1401,34 +1393,11 @@ void MockSSLClientSocket::GetSSLCertRequestInfo(
}
SSLClientSocket::NextProtoStatus MockSSLClientSocket::GetNextProto(
- std::string* proto) {
+ std::string* proto) const {
*proto = data_->next_proto;
return data_->next_proto_status;
}
-bool MockSSLClientSocket::set_was_npn_negotiated(bool negotiated) {
- is_npn_state_set_ = true;
- return new_npn_value_ = negotiated;
-}
-
-bool MockSSLClientSocket::WasNpnNegotiated() const {
- if (is_npn_state_set_)
- return new_npn_value_;
- return data_->was_npn_negotiated;
-}
-
-NextProto MockSSLClientSocket::GetNegotiatedProtocol() const {
- if (is_protocol_negotiated_set_)
- return protocol_negotiated_;
- return data_->protocol_negotiated;
-}
-
-void MockSSLClientSocket::set_protocol_negotiated(
- NextProto protocol_negotiated) {
- is_protocol_negotiated_set_ = true;
- protocol_negotiated_ = protocol_negotiated;
-}
-
bool MockSSLClientSocket::WasChannelIDSent() const {
return data_->channel_id_sent;
}
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/ssl_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698