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

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

Issue 165217: Revert 22811 - Merge 21988 Fix crash in client_socket_pool_base.cc.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Modified: svn:mergeinfo
Reverse-merged /trunk/src/net/socket/client_socket_pool_base.h:r21988
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_BASE_H_ 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 typedef std::deque<Request> RequestQueue; 190 typedef std::deque<Request> RequestQueue;
191 typedef std::map<const ClientSocketHandle*, Request> RequestMap; 191 typedef std::map<const ClientSocketHandle*, Request> RequestMap;
192 192
193 // A Group is allocated per group_name when there are idle sockets or pending 193 // A Group is allocated per group_name when there are idle sockets or pending
194 // requests. Otherwise, the Group object is removed from the map. 194 // requests. Otherwise, the Group object is removed from the map.
195 struct Group { 195 struct Group {
196 Group() : active_socket_count(0) {} 196 Group() : active_socket_count(0) {}
197 197
198 bool IsEmpty() const { 198 bool IsEmpty() const {
199 return active_socket_count == 0 && idle_sockets.empty() && jobs.empty() && 199 return active_socket_count == 0 && idle_sockets.empty() && jobs.empty();
200 pending_requests.empty() && connecting_requests.empty();
201 } 200 }
202 201
203 bool HasAvailableSocketSlot(int max_sockets_per_group) const { 202 bool HasAvailableSocketSlot(int max_sockets_per_group) const {
204 return active_socket_count + static_cast<int>(jobs.size()) < 203 return active_socket_count + static_cast<int>(jobs.size()) <
205 max_sockets_per_group; 204 max_sockets_per_group;
206 } 205 }
207 206
208 std::deque<IdleSocket> idle_sockets; 207 std::deque<IdleSocket> idle_sockets;
209 std::set<const ConnectJob*> jobs; 208 std::set<const ConnectJob*> jobs;
210 RequestQueue pending_requests; 209 RequestQueue pending_requests;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 287
289 // Controls whether or not we use late binding of sockets. 288 // Controls whether or not we use late binding of sockets.
290 static bool g_late_binding; 289 static bool g_late_binding;
291 290
292 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); 291 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase);
293 }; 292 };
294 293
295 } // namespace net 294 } // namespace net
296 295
297 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 296 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
OLDNEW
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698