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

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

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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_pool.cc ('k') | net/socket/client_socket_pool_base_unittest.cc » ('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) 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 // A ClientSocketPoolBase is used to restrict the number of sockets open at 5 // A ClientSocketPoolBase is used to restrict the number of sockets open at
6 // a time. It also maintains a list of idle persistent sockets for reuse. 6 // a time. It also maintains a list of idle persistent sockets for reuse.
7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle 7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle
8 // the core logic of (1) restricting the number of active (connected or 8 // the core logic of (1) restricting the number of active (connected or
9 // connecting) sockets per "group" (generally speaking, the hostname), (2) 9 // connecting) sockets per "group" (generally speaking, the hostname), (2)
10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3) 10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3)
11 // limiting the total number of active sockets in the system. 11 // limiting the total number of active sockets in the system.
12 // 12 //
13 // ClientSocketPoolBase abstracts socket connection details behind ConnectJob, 13 // ClientSocketPoolBase abstracts socket connection details behind ConnectJob,
14 // ConnectJobFactory, and SocketParams. When a socket "slot" becomes available, 14 // ConnectJobFactory, and SocketParams. When a socket "slot" becomes available,
15 // the ClientSocketPoolBase will ask the ConnectJobFactory to create a 15 // the ClientSocketPoolBase will ask the ConnectJobFactory to create a
16 // ConnectJob with a SocketParams. Subclasses of ClientSocketPool should 16 // ConnectJob with a SocketParams. Subclasses of ClientSocketPool should
17 // implement their socket specific connection by subclassing ConnectJob and 17 // implement their socket specific connection by subclassing ConnectJob and
18 // implementing ConnectJob::ConnectInternal(). They can control the parameters 18 // implementing ConnectJob::ConnectInternal(). They can control the parameters
19 // passed to each new ConnectJob instance via their ConnectJobFactory subclass 19 // passed to each new ConnectJob instance via their ConnectJobFactory subclass
20 // and templated SocketParams parameter. 20 // and templated SocketParams parameter.
21 // 21 //
22 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 22 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
23 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 23 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
24 24
25 #include <stddef.h>
26 #include <stdint.h>
27
25 #include <cstddef> 28 #include <cstddef>
26 #include <deque> 29 #include <deque>
27 #include <list> 30 #include <list>
28 #include <map> 31 #include <map>
29 #include <set> 32 #include <set>
30 #include <string> 33 #include <string>
31 #include <vector> 34 #include <vector>
32 35
33 #include "base/basictypes.h" 36 #include "base/macros.h"
34 #include "base/memory/ref_counted.h" 37 #include "base/memory/ref_counted.h"
35 #include "base/memory/scoped_ptr.h" 38 #include "base/memory/scoped_ptr.h"
36 #include "base/memory/weak_ptr.h" 39 #include "base/memory/weak_ptr.h"
37 #include "base/time/time.h" 40 #include "base/time/time.h"
38 #include "base/timer/timer.h" 41 #include "base/timer/timer.h"
39 #include "net/base/address_list.h" 42 #include "net/base/address_list.h"
40 #include "net/base/completion_callback.h" 43 #include "net/base/completion_callback.h"
41 #include "net/base/load_states.h" 44 #include "net/base/load_states.h"
42 #include "net/base/load_timing_info.h" 45 #include "net/base/load_timing_info.h"
43 #include "net/base/net_errors.h" 46 #include "net/base/net_errors.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 153
151 // ClientSocketPoolBaseHelper is an internal class that implements almost all 154 // ClientSocketPoolBaseHelper is an internal class that implements almost all
152 // the functionality from ClientSocketPoolBase without using templates. 155 // the functionality from ClientSocketPoolBase without using templates.
153 // ClientSocketPoolBase adds templated definitions built on top of 156 // ClientSocketPoolBase adds templated definitions built on top of
154 // ClientSocketPoolBaseHelper. This class is not for external use, please use 157 // ClientSocketPoolBaseHelper. This class is not for external use, please use
155 // ClientSocketPoolBase instead. 158 // ClientSocketPoolBase instead.
156 class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper 159 class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
157 : public ConnectJob::Delegate, 160 : public ConnectJob::Delegate,
158 public NetworkChangeNotifier::IPAddressObserver { 161 public NetworkChangeNotifier::IPAddressObserver {
159 public: 162 public:
160 typedef uint32 Flags; 163 typedef uint32_t Flags;
161 164
162 // Used to specify specific behavior for the ClientSocketPool. 165 // Used to specify specific behavior for the ClientSocketPool.
163 enum Flag { 166 enum Flag {
164 NORMAL = 0, // Normal behavior. 167 NORMAL = 0, // Normal behavior.
165 NO_IDLE_SOCKETS = 0x1, // Do not return an idle socket. Create a new one. 168 NO_IDLE_SOCKETS = 0x1, // Do not return an idle socket. Create a new one.
166 }; 169 };
167 170
168 class NET_EXPORT_PRIVATE Request { 171 class NET_EXPORT_PRIVATE Request {
169 public: 172 public:
170 Request(ClientSocketHandle* handle, 173 Request(ClientSocketHandle* handle,
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 }; 875 };
873 876
874 internal::ClientSocketPoolBaseHelper helper_; 877 internal::ClientSocketPoolBaseHelper helper_;
875 878
876 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); 879 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase);
877 }; 880 };
878 881
879 } // namespace net 882 } // namespace net
880 883
881 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 884 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool.cc ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698