OLD | NEW |
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 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // Should be used for response of OnAuthRequired. | 161 // Should be used for response of OnAuthRequired. |
162 virtual void RestartWithAuth(const AuthCredentials& credentials); | 162 virtual void RestartWithAuth(const AuthCredentials& credentials); |
163 | 163 |
164 // Detach delegate. Call before delegate is deleted. | 164 // Detach delegate. Call before delegate is deleted. |
165 // Once delegate is detached, close the socket stream and never call delegate | 165 // Once delegate is detached, close the socket stream and never call delegate |
166 // back. | 166 // back. |
167 virtual void DetachDelegate(); | 167 virtual void DetachDelegate(); |
168 | 168 |
169 const ProxyServer& proxy_server() const; | 169 const ProxyServer& proxy_server() const; |
170 | 170 |
171 // Sets an alternative HostResolver. For testing purposes only. | |
172 void SetHostResolver(HostResolver* host_resolver); | |
173 | |
174 // Sets an alternative ClientSocketFactory. Doesn't take ownership of | 171 // Sets an alternative ClientSocketFactory. Doesn't take ownership of |
175 // |factory|. For testing purposes only. | 172 // |factory|. For testing purposes only. |
176 void SetClientSocketFactory(ClientSocketFactory* factory); | 173 void SetClientSocketFactory(ClientSocketFactory* factory); |
177 | 174 |
178 // Cancels the connection because of an error. | 175 // Cancels the connection because of an error. |
179 // |error| is net::Error which represents the error. | 176 // |error| is net::Error which represents the error. |
180 void CancelWithError(int error); | 177 void CancelWithError(int error); |
181 | 178 |
182 // Cancels the connection because of receiving a certificate with an error. | 179 // Cancels the connection because of receiving a certificate with an error. |
183 void CancelWithSSLError(const SSLInfo& ssl_info); | 180 void CancelWithSSLError(const SSLInfo& ssl_info); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 bool server_closed_; | 374 bool server_closed_; |
378 | 375 |
379 scoped_ptr<SocketStreamMetrics> metrics_; | 376 scoped_ptr<SocketStreamMetrics> metrics_; |
380 | 377 |
381 DISALLOW_COPY_AND_ASSIGN(SocketStream); | 378 DISALLOW_COPY_AND_ASSIGN(SocketStream); |
382 }; | 379 }; |
383 | 380 |
384 } // namespace net | 381 } // namespace net |
385 | 382 |
386 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 383 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
OLD | NEW |