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

Unified Diff: net/socket/socket_test_util.h

Issue 981723008: Unwind the SSL connection holdback experiment and remove related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
Index: net/socket/socket_test_util.h
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index d6c7abafd980ffe828ae75cc6009da2f2adf716d..d0ee504d6899ce03962089ce171557e2545bfa24 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -336,12 +336,6 @@ struct SSLSocketDataProvider {
bool channel_id_sent;
ChannelIDService* channel_id_service;
int connection_status;
- // Indicates that the socket should pause in the Connect method.
- bool should_pause_on_connect;
- // Whether or not the Socket should behave like there is a pre-existing
- // session to resume. Whether or not such a session is reported as
- // resumed is controlled by |connection_status|.
- bool is_in_session_cache;
};
// A DataProvider where the client must write a request before the reads (e.g.
@@ -645,12 +639,6 @@ class MockClientSocketFactory : public ClientSocketFactory {
return mock_data_;
}
- // Note: this method is unsafe; the elements of the returned vector
- // are not necessarily valid.
- const std::vector<MockSSLClientSocket*>& ssl_client_sockets() const {
- return ssl_client_sockets_;
- }
-
// ClientSocketFactory
scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
@@ -671,7 +659,6 @@ class MockClientSocketFactory : public ClientSocketFactory {
private:
SocketDataProviderArray<SocketDataProvider> mock_data_;
SocketDataProviderArray<SSLSocketDataProvider> mock_ssl_data_;
- std::vector<MockSSLClientSocket*> ssl_client_sockets_;
};
class MockClientSocket : public SSLClientSocket {
@@ -705,9 +692,6 @@ class MockClientSocket : public SSLClientSocket {
void SetOmniboxSpeculation() override {}
// SSLClientSocket implementation.
- std::string GetSessionCacheKey() const override;
- bool InSessionCache() const override;
- void SetHandshakeCompletionCallback(const base::Closure& cb) override;
void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
int ExportKeyingMaterial(const base::StringPiece& label,
bool has_context,
@@ -735,7 +719,6 @@ class MockClientSocket : public SSLClientSocket {
BoundNetLog net_log_;
- private:
davidben 2015/03/09 18:02:36 Probably want to keep that line.
base::WeakPtrFactory<MockClientSocket> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MockClientSocket);
@@ -966,9 +949,6 @@ class MockSSLClientSocket : public MockClientSocket, public AsyncSocket {
bool GetSSLInfo(SSLInfo* ssl_info) override;
// SSLClientSocket implementation.
- std::string GetSessionCacheKey() const override;
- bool InSessionCache() const override;
- void SetHandshakeCompletionCallback(const base::Closure& cb) override;
void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
NextProtoStatus GetNextProto(std::string* proto) override;
bool set_was_npn_negotiated(bool negotiated) override;
@@ -983,45 +963,18 @@ class MockSSLClientSocket : public MockClientSocket, public AsyncSocket {
void set_channel_id_sent(bool channel_id_sent) override;
ChannelIDService* GetChannelIDService() const override;
- bool reached_connect() const { return reached_connect_; }
-
- // Resumes the connection of a socket that was paused for testing.
- // |connect_callback_| should be set before invoking this method.
- void RestartPausedConnect();
-
private:
- enum ConnectState {
- STATE_NONE,
- STATE_SSL_CONNECT,
- STATE_SSL_CONNECT_COMPLETE,
- };
-
- void OnIOComplete(int result);
-
- // Runs the state transistion loop.
- int DoConnectLoop(int result);
-
- int DoSSLConnect();
- int DoSSLConnectComplete(int result);
+ static void ConnectCallback(MockSSLClientSocket* ssl_client_socket,
+ const CompletionCallback& callback,
+ int rv);
scoped_ptr<ClientSocketHandle> transport_;
- HostPortPair host_port_pair_;
SSLSocketDataProvider* data_;
bool is_npn_state_set_;
bool new_npn_value_;
bool is_protocol_negotiated_set_;
NextProto protocol_negotiated_;
- CompletionCallback connect_callback_;
- // Indicates what state of Connect the socket should enter.
- ConnectState next_connect_state_;
- // True if the Connect method has been called on the socket.
- bool reached_connect_;
-
- base::Closure handshake_completion_callback_;
-
- base::WeakPtrFactory<MockSSLClientSocket> weak_factory_;
-
DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket);
};

Powered by Google App Engine
This is Rietveld 408576698