| OLD | NEW |
| 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_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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/string16.h" | |
| 17 #include "base/task.h" | 16 #include "base/task.h" |
| 18 #include "net/base/address_list.h" | 17 #include "net/base/address_list.h" |
| 19 #include "net/base/completion_callback.h" | 18 #include "net/base/completion_callback.h" |
| 20 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
| 21 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
| 22 #include "net/base/net_log.h" | 21 #include "net/base/net_log.h" |
| 23 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 24 #include "net/base/ssl_config_service.h" | 23 #include "net/base/ssl_config_service.h" |
| 25 #include "net/http/http_auth.h" | 24 #include "net/http/http_auth.h" |
| 26 #include "net/http/http_auth_cache.h" | 25 #include "net/http/http_auth_cache.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Returns false if size of buffered data would exceeds | 143 // Returns false if size of buffered data would exceeds |
| 145 // |max_pending_send_allowed_| and |data| is not sent at all. | 144 // |max_pending_send_allowed_| and |data| is not sent at all. |
| 146 virtual bool SendData(const char* data, int len); | 145 virtual bool SendData(const char* data, int len); |
| 147 | 146 |
| 148 // Requests to close the connection. | 147 // Requests to close the connection. |
| 149 // Once the connection is closed, calls delegate's OnClose. | 148 // Once the connection is closed, calls delegate's OnClose. |
| 150 virtual void Close(); | 149 virtual void Close(); |
| 151 | 150 |
| 152 // Restarts with authentication info. | 151 // Restarts with authentication info. |
| 153 // Should be used for response of OnAuthRequired. | 152 // Should be used for response of OnAuthRequired. |
| 154 virtual void RestartWithAuth( | 153 virtual void RestartWithAuth(const AuthCredentials& credentials); |
| 155 const string16& username, | |
| 156 const string16& password); | |
| 157 | 154 |
| 158 // Detach delegate. Call before delegate is deleted. | 155 // Detach delegate. Call before delegate is deleted. |
| 159 // Once delegate is detached, close the socket stream and never call delegate | 156 // Once delegate is detached, close the socket stream and never call delegate |
| 160 // back. | 157 // back. |
| 161 virtual void DetachDelegate(); | 158 virtual void DetachDelegate(); |
| 162 | 159 |
| 163 const ProxyServer& proxy_server() const; | 160 const ProxyServer& proxy_server() const; |
| 164 | 161 |
| 165 // Sets an alternative HostResolver. For testing purposes only. | 162 // Sets an alternative HostResolver. For testing purposes only. |
| 166 void SetHostResolver(HostResolver* host_resolver); | 163 void SetHostResolver(HostResolver* host_resolver); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 bool server_closed_; | 359 bool server_closed_; |
| 363 | 360 |
| 364 scoped_ptr<SocketStreamMetrics> metrics_; | 361 scoped_ptr<SocketStreamMetrics> metrics_; |
| 365 | 362 |
| 366 DISALLOW_COPY_AND_ASSIGN(SocketStream); | 363 DISALLOW_COPY_AND_ASSIGN(SocketStream); |
| 367 }; | 364 }; |
| 368 | 365 |
| 369 } // namespace net | 366 } // namespace net |
| 370 | 367 |
| 371 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 368 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
| OLD | NEW |