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

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

Issue 8568021: Add OVERRIDE to net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: net only Created 9 years, 1 month 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 | « net/socket/socks_client_socket.h ('k') | net/socket/ssl_client_socket_mac.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_SOCKS_CLIENT_SOCKET_POOL_H_ 5 #ifndef NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_
6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ 6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 SOCKSConnectJob(const std::string& group_name, 60 SOCKSConnectJob(const std::string& group_name,
61 const scoped_refptr<SOCKSSocketParams>& params, 61 const scoped_refptr<SOCKSSocketParams>& params,
62 const base::TimeDelta& timeout_duration, 62 const base::TimeDelta& timeout_duration,
63 TransportClientSocketPool* transport_pool, 63 TransportClientSocketPool* transport_pool,
64 HostResolver* host_resolver, 64 HostResolver* host_resolver,
65 Delegate* delegate, 65 Delegate* delegate,
66 NetLog* net_log); 66 NetLog* net_log);
67 virtual ~SOCKSConnectJob(); 67 virtual ~SOCKSConnectJob();
68 68
69 // ConnectJob methods. 69 // ConnectJob methods.
70 virtual LoadState GetLoadState() const; 70 virtual LoadState GetLoadState() const OVERRIDE;
71 71
72 private: 72 private:
73 enum State { 73 enum State {
74 STATE_TRANSPORT_CONNECT, 74 STATE_TRANSPORT_CONNECT,
75 STATE_TRANSPORT_CONNECT_COMPLETE, 75 STATE_TRANSPORT_CONNECT_COMPLETE,
76 STATE_SOCKS_CONNECT, 76 STATE_SOCKS_CONNECT,
77 STATE_SOCKS_CONNECT_COMPLETE, 77 STATE_SOCKS_CONNECT_COMPLETE,
78 STATE_NONE, 78 STATE_NONE,
79 }; 79 };
80 80
81 void OnIOComplete(int result); 81 void OnIOComplete(int result);
82 82
83 // Runs the state transition loop. 83 // Runs the state transition loop.
84 int DoLoop(int result); 84 int DoLoop(int result);
85 85
86 int DoTransportConnect(); 86 int DoTransportConnect();
87 int DoTransportConnectComplete(int result); 87 int DoTransportConnectComplete(int result);
88 int DoSOCKSConnect(); 88 int DoSOCKSConnect();
89 int DoSOCKSConnectComplete(int result); 89 int DoSOCKSConnectComplete(int result);
90 90
91 // Begins the transport connection and the SOCKS handshake. Returns OK on 91 // Begins the transport connection and the SOCKS handshake. Returns OK on
92 // success and ERR_IO_PENDING if it cannot immediately service the request. 92 // success and ERR_IO_PENDING if it cannot immediately service the request.
93 // Otherwise, it returns a net error code. 93 // Otherwise, it returns a net error code.
94 virtual int ConnectInternal(); 94 virtual int ConnectInternal() OVERRIDE;
95 95
96 scoped_refptr<SOCKSSocketParams> socks_params_; 96 scoped_refptr<SOCKSSocketParams> socks_params_;
97 TransportClientSocketPool* const transport_pool_; 97 TransportClientSocketPool* const transport_pool_;
98 HostResolver* const resolver_; 98 HostResolver* const resolver_;
99 99
100 State next_state_; 100 State next_state_;
101 OldCompletionCallbackImpl<SOCKSConnectJob> callback_; 101 OldCompletionCallbackImpl<SOCKSConnectJob> callback_;
102 scoped_ptr<ClientSocketHandle> transport_socket_handle_; 102 scoped_ptr<ClientSocketHandle> transport_socket_handle_;
103 scoped_ptr<StreamSocket> socket_; 103 scoped_ptr<StreamSocket> socket_;
104 104
(...skipping 11 matching lines...) Expand all
116 NetLog* net_log); 116 NetLog* net_log);
117 117
118 virtual ~SOCKSClientSocketPool(); 118 virtual ~SOCKSClientSocketPool();
119 119
120 // ClientSocketPool methods: 120 // ClientSocketPool methods:
121 virtual int RequestSocket(const std::string& group_name, 121 virtual int RequestSocket(const std::string& group_name,
122 const void* connect_params, 122 const void* connect_params,
123 RequestPriority priority, 123 RequestPriority priority,
124 ClientSocketHandle* handle, 124 ClientSocketHandle* handle,
125 OldCompletionCallback* callback, 125 OldCompletionCallback* callback,
126 const BoundNetLog& net_log); 126 const BoundNetLog& net_log) OVERRIDE;
127 127
128 virtual void RequestSockets(const std::string& group_name, 128 virtual void RequestSockets(const std::string& group_name,
129 const void* params, 129 const void* params,
130 int num_sockets, 130 int num_sockets,
131 const BoundNetLog& net_log); 131 const BoundNetLog& net_log) OVERRIDE;
132 132
133 virtual void CancelRequest(const std::string& group_name, 133 virtual void CancelRequest(const std::string& group_name,
134 ClientSocketHandle* handle); 134 ClientSocketHandle* handle) OVERRIDE;
135 135
136 virtual void ReleaseSocket(const std::string& group_name, 136 virtual void ReleaseSocket(const std::string& group_name,
137 StreamSocket* socket, 137 StreamSocket* socket,
138 int id); 138 int id) OVERRIDE;
139 139
140 virtual void Flush(); 140 virtual void Flush() OVERRIDE;
141 141
142 virtual void CloseIdleSockets(); 142 virtual void CloseIdleSockets() OVERRIDE;
143 143
144 virtual int IdleSocketCount() const; 144 virtual int IdleSocketCount() const OVERRIDE;
145 145
146 virtual int IdleSocketCountInGroup(const std::string& group_name) const; 146 virtual int IdleSocketCountInGroup(
147 const std::string& group_name) const OVERRIDE;
147 148
148 virtual LoadState GetLoadState(const std::string& group_name, 149 virtual LoadState GetLoadState(
149 const ClientSocketHandle* handle) const; 150 const std::string& group_name,
151 const ClientSocketHandle* handle) const OVERRIDE;
150 152
151 virtual base::DictionaryValue* GetInfoAsValue( 153 virtual base::DictionaryValue* GetInfoAsValue(
152 const std::string& name, 154 const std::string& name,
153 const std::string& type, 155 const std::string& type,
154 bool include_nested_pools) const; 156 bool include_nested_pools) const OVERRIDE;
155 157
156 virtual base::TimeDelta ConnectionTimeout() const; 158 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
157 159
158 virtual ClientSocketPoolHistograms* histograms() const; 160 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
159 161
160 private: 162 private:
161 typedef ClientSocketPoolBase<SOCKSSocketParams> PoolBase; 163 typedef ClientSocketPoolBase<SOCKSSocketParams> PoolBase;
162 164
163 class SOCKSConnectJobFactory : public PoolBase::ConnectJobFactory { 165 class SOCKSConnectJobFactory : public PoolBase::ConnectJobFactory {
164 public: 166 public:
165 SOCKSConnectJobFactory(TransportClientSocketPool* transport_pool, 167 SOCKSConnectJobFactory(TransportClientSocketPool* transport_pool,
166 HostResolver* host_resolver, 168 HostResolver* host_resolver,
167 NetLog* net_log) 169 NetLog* net_log)
168 : transport_pool_(transport_pool), 170 : transport_pool_(transport_pool),
169 host_resolver_(host_resolver), 171 host_resolver_(host_resolver),
170 net_log_(net_log) {} 172 net_log_(net_log) {}
171 173
172 virtual ~SOCKSConnectJobFactory() {} 174 virtual ~SOCKSConnectJobFactory() {}
173 175
174 // ClientSocketPoolBase::ConnectJobFactory methods. 176 // ClientSocketPoolBase::ConnectJobFactory methods.
175 virtual ConnectJob* NewConnectJob( 177 virtual ConnectJob* NewConnectJob(
176 const std::string& group_name, 178 const std::string& group_name,
177 const PoolBase::Request& request, 179 const PoolBase::Request& request,
178 ConnectJob::Delegate* delegate) const; 180 ConnectJob::Delegate* delegate) const OVERRIDE;
179 181
180 virtual base::TimeDelta ConnectionTimeout() const; 182 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
181 183
182 private: 184 private:
183 TransportClientSocketPool* const transport_pool_; 185 TransportClientSocketPool* const transport_pool_;
184 HostResolver* const host_resolver_; 186 HostResolver* const host_resolver_;
185 NetLog* net_log_; 187 NetLog* net_log_;
186 188
187 DISALLOW_COPY_AND_ASSIGN(SOCKSConnectJobFactory); 189 DISALLOW_COPY_AND_ASSIGN(SOCKSConnectJobFactory);
188 }; 190 };
189 191
190 TransportClientSocketPool* const transport_pool_; 192 TransportClientSocketPool* const transport_pool_;
191 PoolBase base_; 193 PoolBase base_;
192 194
193 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocketPool); 195 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocketPool);
194 }; 196 };
195 197
196 REGISTER_SOCKET_PARAMS_FOR_POOL(SOCKSClientSocketPool, SOCKSSocketParams); 198 REGISTER_SOCKET_PARAMS_FOR_POOL(SOCKSClientSocketPool, SOCKSSocketParams);
197 199
198 } // namespace net 200 } // namespace net
199 201
200 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ 202 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket.h ('k') | net/socket/ssl_client_socket_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698