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

Unified Diff: net/socket/ssl_client_socket_pool.h

Issue 328903004: SSL Connect Job Waiting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a command line flag that enables my changes. Created 6 years, 6 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/ssl_client_socket_pool.h
diff --git a/net/socket/ssl_client_socket_pool.h b/net/socket/ssl_client_socket_pool.h
index e03b76ade6ab5946e2d981e7d7802b1cb70d6dba..0ad42db4285840c7c54ae274d1e82cdeda7626a4 100644
--- a/net/socket/ssl_client_socket_pool.h
+++ b/net/socket/ssl_client_socket_pool.h
@@ -5,7 +5,9 @@
#ifndef NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_
#define NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_
+#include <map>
#include <string>
+#include <vector>
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -17,6 +19,7 @@
#include "net/socket/client_socket_pool_base.h"
#include "net/socket/client_socket_pool_histograms.h"
#include "net/socket/ssl_client_socket.h"
+#include "net/socket/ssl_client_socket_openssl.h"
#include "net/ssl/ssl_config_service.h"
namespace net {
@@ -98,26 +101,31 @@ class NET_EXPORT_PRIVATE SSLSocketParams
// connection as specified in the params.
class SSLConnectJob : public ConnectJob {
public:
- SSLConnectJob(
- const std::string& group_name,
- RequestPriority priority,
- const scoped_refptr<SSLSocketParams>& params,
- const base::TimeDelta& timeout_duration,
- TransportClientSocketPool* transport_pool,
- SOCKSClientSocketPool* socks_pool,
- HttpProxyClientSocketPool* http_proxy_pool,
- ClientSocketFactory* client_socket_factory,
- HostResolver* host_resolver,
- const SSLClientSocketContext& context,
- Delegate* delegate,
- NetLog* net_log);
+ typedef std::vector<SSLConnectJob*> PendingJobList;
+ SSLConnectJob(const std::string& group_name,
Ryan Sleevi 2014/06/13 23:24:22 New line before the constructor
mshelley1 2014/06/16 19:02:50 Done.
+ RequestPriority priority,
+ const scoped_refptr<SSLSocketParams>& params,
+ const base::TimeDelta& timeout_duration,
+ TransportClientSocketPool* transport_pool,
+ SOCKSClientSocketPool* socks_pool,
+ HttpProxyClientSocketPool* http_proxy_pool,
+ ClientSocketFactory* client_socket_factory,
+ HostResolver* host_resolver,
+ const SSLClientSocketContext& context,
+ Delegate* delegate,
+ NetLog* net_log,
+ PendingJobList* pending);
virtual ~SSLConnectJob();
+ static bool enable_job_waiting_;
wtc 2014/06/13 22:47:24 This (static) data member should be private.
mshelley1 2014/06/16 19:02:50 Done.
+
// ConnectJob methods.
virtual LoadState GetLoadState() const OVERRIDE;
virtual void GetAdditionalErrorState(ClientSocketHandle * handle) OVERRIDE;
+ static NET_EXPORT void EnableJobWaiting(bool enable);
+
private:
enum State {
STATE_TRANSPORT_CONNECT,
@@ -126,6 +134,8 @@ class SSLConnectJob : public ConnectJob {
STATE_SOCKS_CONNECT_COMPLETE,
STATE_TUNNEL_CONNECT,
STATE_TUNNEL_CONNECT_COMPLETE,
+ STATE_CHECK_FOR_RESUME,
+ STATE_WAIT,
wtc 2014/06/13 22:47:24 Nit: this state's name should be more informative.
mshelley1 2014/06/16 19:02:50 Done.
STATE_SSL_CONNECT,
STATE_SSL_CONNECT_COMPLETE,
STATE_NONE,
@@ -142,9 +152,14 @@ class SSLConnectJob : public ConnectJob {
int DoSOCKSConnectComplete(int result);
int DoTunnelConnect();
int DoTunnelConnectComplete(int result);
+ int DoCheckForResume();
int DoSSLConnect();
int DoSSLConnectComplete(int result);
+ void DoSSL();
Ryan Sleevi 2014/06/13 23:24:22 First reaction: This needs a better (more descript
mshelley1 2014/06/16 19:02:50 Done.
+
+ std::string GetSessionCacheKey();
+
// Returns the initial state for the state machine based on the
// |connection_type|.
static State GetInitialState(SSLSocketParams::ConnectionType connection_type);
@@ -168,6 +183,7 @@ class SSLConnectJob : public ConnectJob {
scoped_ptr<ClientSocketHandle> transport_socket_handle_;
scoped_ptr<SSLClientSocket> ssl_socket_;
+ PendingJobList* pending_;
wtc 2014/06/13 22:47:24 Rename this member pending_job_list_ or pending_jo
mshelley1 2014/06/16 19:02:50 Done.
HttpResponseInfo error_response_info_;
DISALLOW_COPY_AND_ASSIGN(SSLConnectJob);
@@ -264,6 +280,8 @@ class NET_EXPORT_PRIVATE SSLClientSocketPool
class SSLConnectJobFactory : public PoolBase::ConnectJobFactory {
public:
+ typedef std::map<std::string, SSLConnectJob::PendingJobList*> PendingJobMap;
Ryan Sleevi 2014/06/13 23:24:22 You don't need to make this typedef public, becaus
mshelley1 2014/06/16 19:02:50 Done.
+
SSLConnectJobFactory(
TransportClientSocketPool* transport_pool,
SOCKSClientSocketPool* socks_pool,
@@ -292,6 +310,7 @@ class NET_EXPORT_PRIVATE SSLClientSocketPool
const SSLClientSocketContext context_;
base::TimeDelta timeout_;
NetLog* net_log_;
+ PendingJobMap* pending_;
DISALLOW_COPY_AND_ASSIGN(SSLConnectJobFactory);
};

Powered by Google App Engine
This is Rietveld 408576698