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

Side by Side Diff: net/socket/client_socket_pool.h

Issue 2994003: Refactor how ClientSocketPoolBaseHelper avoids re-entrancy. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge. Created 10 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
« no previous file with comments | « net/socket/client_socket_handle.cc ('k') | net/socket/client_socket_pool_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_CLIENT_SOCKET_POOL_H_ 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_H_
6 #define NET_SOCKET_CLIENT_SOCKET_POOL_H_ 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 ClientSocketHandle* handle, 64 ClientSocketHandle* handle,
65 CompletionCallback* callback, 65 CompletionCallback* callback,
66 const BoundNetLog& net_log) = 0; 66 const BoundNetLog& net_log) = 0;
67 67
68 // Called to cancel a RequestSocket call that returned ERR_IO_PENDING. The 68 // Called to cancel a RequestSocket call that returned ERR_IO_PENDING. The
69 // same handle parameter must be passed to this method as was passed to the 69 // same handle parameter must be passed to this method as was passed to the
70 // RequestSocket call being cancelled. The associated CompletionCallback is 70 // RequestSocket call being cancelled. The associated CompletionCallback is
71 // not run. However, for performance, we will let one ConnectJob complete 71 // not run. However, for performance, we will let one ConnectJob complete
72 // and go idle. 72 // and go idle.
73 virtual void CancelRequest(const std::string& group_name, 73 virtual void CancelRequest(const std::string& group_name,
74 const ClientSocketHandle* handle) = 0; 74 ClientSocketHandle* handle) = 0;
75 75
76 // Called to release a socket once the socket is no longer needed. If the 76 // Called to release a socket once the socket is no longer needed. If the
77 // socket still has an established connection, then it will be added to the 77 // socket still has an established connection, then it will be added to the
78 // set of idle sockets to be used to satisfy future RequestSocket calls. 78 // set of idle sockets to be used to satisfy future RequestSocket calls.
79 // Otherwise, the ClientSocket is destroyed. |id| is used to differentiate 79 // Otherwise, the ClientSocket is destroyed. |id| is used to differentiate
80 // between updated versions of the same pool instance. The pool's id will 80 // between updated versions of the same pool instance. The pool's id will
81 // change when it flushes, so it can use this |id| to discard sockets with 81 // change when it flushes, so it can use this |id| to discard sockets with
82 // mismatched ids. 82 // mismatched ids.
83 virtual void ReleaseSocket(const std::string& group_name, 83 virtual void ReleaseSocket(const std::string& group_name,
84 ClientSocket* socket, 84 ClientSocket* socket,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // should be optimized out by the compiler. 149 // should be optimized out by the compiler.
150 #define REGISTER_SOCKET_PARAMS_FOR_POOL(pool_type, socket_params) \ 150 #define REGISTER_SOCKET_PARAMS_FOR_POOL(pool_type, socket_params) \
151 template<> \ 151 template<> \
152 struct SocketParamTraits<pool_type, scoped_refptr<socket_params> > \ 152 struct SocketParamTraits<pool_type, scoped_refptr<socket_params> > \
153 : public base::true_type { \ 153 : public base::true_type { \
154 } 154 }
155 155
156 } // namespace net 156 } // namespace net
157 157
158 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ 158 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_
OLDNEW
« no previous file with comments | « net/socket/client_socket_handle.cc ('k') | net/socket/client_socket_pool_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698