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

Side by Side 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: 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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 void Clear() { 164 void Clear() {
165 pending_sockets_.clear(); 165 pending_sockets_.clear();
166 callbacks_.clear(); 166 callbacks_.clear();
167 } 167 }
168 168
169 // Tells all pending connections to resume. 169 // Tells all pending connections to resume.
170 void RunAllJobs() { 170 void RunAllJobs() {
171 for (std::vector<base::Closure>::iterator it = callbacks_.begin(); 171 for (std::vector<base::Closure>::iterator it = callbacks_.begin();
172 it != callbacks_.end(); 172 it != callbacks_.end();
173 it++) 173 it++)
174 it->Run(); 174 base::MessageLoopForIO::current()->PostTask(FROM_HERE, *it);
wtc 2014/07/08 17:37:03 1. IMPORTANT: this will make cancelling the callba
mshelley 2014/07/09 21:53:06 The callbacks that are being posted here are bound
175 } 175 }
176 176
177 SSLClientSocket* GetFirstSocket() { 177 SSLClientSocket* GetFirstSocket() {
178 DCHECK(!pending_sockets_.empty()); 178 DCHECK(!pending_sockets_.empty());
179 return pending_sockets_[0]; 179 return pending_sockets_[0];
180 } 180 }
181 181
182 base::Closure GetFirstCallback() { 182 base::Closure GetFirstCallback() {
183 DCHECK(!callbacks_.empty()); 183 DCHECK(!callbacks_.empty());
184 return callbacks_[0]; 184 return callbacks_[0];
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 HttpProxyClientSocketPool* const http_proxy_pool_; 432 HttpProxyClientSocketPool* const http_proxy_pool_;
433 PoolBase base_; 433 PoolBase base_;
434 const scoped_refptr<SSLConfigService> ssl_config_service_; 434 const scoped_refptr<SSLConfigService> ssl_config_service_;
435 435
436 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); 436 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool);
437 }; 437 };
438 438
439 } // namespace net 439 } // namespace net
440 440
441 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ 441 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698