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

Unified Diff: net/socket/ssl_client_socket_pool.h

Issue 364943002: Makes waiting SSLConnectJobs use the message loops to resume their connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed messenger's handling of failed jobs, and switched to use ThreadTaskRunnerHandle Created 6 years, 5 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 1f43e95f534452721f2acebd2dda5ca3d0829044..8780634360b69e20e84a94b1201f0c0dd769aa1b 100644
--- a/net/socket/ssl_client_socket_pool.h
+++ b/net/socket/ssl_client_socket_pool.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
+#include "base/thread_task_runner_handle.h"
Ryan Sleevi 2014/07/10 00:03:22 This should be in the .cc, not the .h In .h files
mshelley 2014/07/10 00:44:20 Done.
#include "base/time/time.h"
#include "net/base/privacy_mode.h"
#include "net/dns/host_resolver.h"
@@ -116,6 +117,8 @@ class NET_EXPORT_PRIVATE SSLConnectJobMessenger {
typedef std::vector<SocketAndCallback> SSLPendingSocketsAndCallbacks;
+ SSLConnectJobMessenger();
+
// Returns true if the given |ssl_socket| should continue its
// SSL connection.
bool CanProceed(SSLClientSocket* ssl_socket);
@@ -132,14 +135,20 @@ class NET_EXPORT_PRIVATE SSLConnectJobMessenger {
// its connection.
void OnJobSucceeded();
- // Processes pending callbacks when a socket encounters an error
+ // Posts a task to process pending callbacks when a socket encounters an error
// while completing its connection.
void OnJobFailed();
+ // Determines which pending socket should be then next leading connection,
+ // and runs that socket's resumption callback.
+ void ConnectNewLeader();
+
private:
// Runs all callbacks stored in |pending_sockets_and_callbacks_|.
- void RunAllJobs(std::vector<SocketAndCallback>& pending_socket_and_callbacks);
+ void RunAllJobs(
+ std::vector<SocketAndCallback>& pending_sockets_and_callbacks);
+ base::WeakPtrFactory<SSLConnectJobMessenger> weak_factory_;
SSLPendingSocketsAndCallbacks pending_sockets_and_callbacks_;
std::vector<SSLClientSocket*> connecting_sockets_;
};

Powered by Google App Engine
This is Rietveld 408576698