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

Unified Diff: net/socket/websocket_transport_client_socket_pool.cc

Issue 394113003: Fix WebSocket race between close and connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase harder. 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
« no previous file with comments | « no previous file | net/socket/websocket_transport_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/websocket_transport_client_socket_pool.cc
diff --git a/net/socket/websocket_transport_client_socket_pool.cc b/net/socket/websocket_transport_client_socket_pool.cc
index 131a9662e9ee37905c0fc20019e5894440f5c7f9..648652040ef2b84f89d96a2756ed8f1f69697a12 100644
--- a/net/socket/websocket_transport_client_socket_pool.cc
+++ b/net/socket/websocket_transport_client_socket_pool.cc
@@ -360,8 +360,12 @@ void WebSocketTransportClientSocketPool::RequestSockets(
void WebSocketTransportClientSocketPool::CancelRequest(
const std::string& group_name,
ClientSocketHandle* handle) {
+ DCHECK(!handle->is_initialized());
if (DeleteStalledRequest(handle))
return;
+ scoped_ptr<StreamSocket> socket = handle->PassSocket();
+ if (socket)
+ ReleaseSocket(handle->group_name(), socket.Pass(), handle->id());
if (!DeleteJob(handle))
pending_callbacks_.erase(handle);
if (!ReachedMaxSocketsLimit() && !stalled_request_queue_.empty())
« no previous file with comments | « no previous file | net/socket/websocket_transport_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698