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

Side by Side Diff: net/socket/ssl_client_socket_pool.cc

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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/ssl_client_socket_pool.h" 5 #include "net/socket/ssl_client_socket_pool.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void SSLConnectJobMessenger::OnJobFailed() { 128 void SSLConnectJobMessenger::OnJobFailed() {
129 if (pending_sockets_and_callbacks_.Empty()) 129 if (pending_sockets_and_callbacks_.Empty())
130 return; 130 return;
131 base::Closure cb = pending_sockets_and_callbacks_.GetFirstCallback(); 131 base::Closure cb = pending_sockets_and_callbacks_.GetFirstCallback();
132 connecting_sockets_.erase(connecting_sockets_.begin()); 132 connecting_sockets_.erase(connecting_sockets_.begin());
133 SSLClientSocket* ssl_socket = pending_sockets_and_callbacks_.GetFirstSocket(); 133 SSLClientSocket* ssl_socket = pending_sockets_and_callbacks_.GetFirstSocket();
134 ssl_socket->SetIsLeader(); 134 ssl_socket->SetIsLeader();
135 connecting_sockets_.push_back(ssl_socket); 135 connecting_sockets_.push_back(ssl_socket);
136 pending_sockets_and_callbacks_.EraseFirstEntry(); 136 pending_sockets_and_callbacks_.EraseFirstEntry();
137 MonitorConnectionResult(ssl_socket); 137 MonitorConnectionResult(ssl_socket);
138 cb.Run(); 138 base::MessageLoopForIO::current()->PostTask(FROM_HERE, cb);
wtc 2014/07/08 17:37:03 IMPORTANT: please make sure the task won't run if
Ryan Sleevi 2014/07/08 19:36:53 Note: You should not use base::MessageLoopForIO di
mshelley 2014/07/09 21:53:06 So I think the issue that you're referring to coul
139 } 139 }
140 140
141 // Timeout for the SSL handshake portion of the connect. 141 // Timeout for the SSL handshake portion of the connect.
142 static const int kSSLHandshakeTimeoutInSeconds = 30; 142 static const int kSSLHandshakeTimeoutInSeconds = 30;
143 143
144 SSLConnectJob::SSLConnectJob(const std::string& group_name, 144 SSLConnectJob::SSLConnectJob(const std::string& group_name,
145 RequestPriority priority, 145 RequestPriority priority,
146 const scoped_refptr<SSLSocketParams>& params, 146 const scoped_refptr<SSLSocketParams>& params,
147 const base::TimeDelta& timeout_duration, 147 const base::TimeDelta& timeout_duration,
148 TransportClientSocketPool* transport_pool, 148 TransportClientSocketPool* transport_pool,
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 if (base_.CloseOneIdleSocket()) 801 if (base_.CloseOneIdleSocket())
802 return true; 802 return true;
803 return base_.CloseOneIdleConnectionInHigherLayeredPool(); 803 return base_.CloseOneIdleConnectionInHigherLayeredPool();
804 } 804 }
805 805
806 void SSLClientSocketPool::OnSSLConfigChanged() { 806 void SSLClientSocketPool::OnSSLConfigChanged() {
807 FlushWithError(ERR_NETWORK_CHANGED); 807 FlushWithError(ERR_NETWORK_CHANGED);
808 } 808 }
809 809
810 } // namespace net 810 } // namespace net
OLDNEW
« net/socket/ssl_client_socket_pool.h ('K') | « net/socket/ssl_client_socket_pool.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698