| 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_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ | 5 #ifndef NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ |
| 6 #define NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ | 6 #define NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // On destruction Disconnect() is called. | 54 // On destruction Disconnect() is called. |
| 55 virtual ~SpdyProxyClientSocket(); | 55 virtual ~SpdyProxyClientSocket(); |
| 56 | 56 |
| 57 // ProxyClientSocket implementation. | 57 // ProxyClientSocket implementation. |
| 58 virtual const HttpResponseInfo* GetConnectResponseInfo() const OVERRIDE; | 58 virtual const HttpResponseInfo* GetConnectResponseInfo() const OVERRIDE; |
| 59 virtual HttpStream* CreateConnectResponseStream() OVERRIDE; | 59 virtual HttpStream* CreateConnectResponseStream() OVERRIDE; |
| 60 virtual int RestartWithAuth(OldCompletionCallback* callback) OVERRIDE; | 60 virtual int RestartWithAuth(OldCompletionCallback* callback) OVERRIDE; |
| 61 virtual const scoped_refptr<HttpAuthController>& auth_controller() OVERRIDE; | 61 virtual const scoped_refptr<HttpAuthController>& auth_controller() OVERRIDE; |
| 62 | 62 |
| 63 // StreamSocket implementation. | 63 // StreamSocket implementation. |
| 64 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; | |
| 65 virtual int Connect(const CompletionCallback& callback) OVERRIDE; | 64 virtual int Connect(const CompletionCallback& callback) OVERRIDE; |
| 66 virtual void Disconnect() OVERRIDE; | 65 virtual void Disconnect() OVERRIDE; |
| 67 virtual bool IsConnected() const OVERRIDE; | 66 virtual bool IsConnected() const OVERRIDE; |
| 68 virtual bool IsConnectedAndIdle() const OVERRIDE; | 67 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 69 virtual const BoundNetLog& NetLog() const OVERRIDE; | 68 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 70 virtual void SetSubresourceSpeculation() OVERRIDE; | 69 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 71 virtual void SetOmniboxSpeculation() OVERRIDE; | 70 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 72 virtual bool WasEverUsed() const OVERRIDE; | 71 virtual bool WasEverUsed() const OVERRIDE; |
| 73 virtual bool UsingTCPFastOpen() const OVERRIDE; | 72 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 74 virtual int64 NumBytesRead() const OVERRIDE; | 73 virtual int64 NumBytesRead() const OVERRIDE; |
| 75 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; | 74 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| 76 | 75 |
| 77 // Socket implementation. | 76 // Socket implementation. |
| 78 virtual int Read(IOBuffer* buf, | 77 virtual int Read(IOBuffer* buf, |
| 79 int buf_len, | 78 int buf_len, |
| 80 OldCompletionCallback* callback) OVERRIDE; | |
| 81 virtual int Read(IOBuffer* buf, | |
| 82 int buf_len, | |
| 83 const CompletionCallback& callback) OVERRIDE; | 79 const CompletionCallback& callback) OVERRIDE; |
| 84 virtual int Write(IOBuffer* buf, | 80 virtual int Write(IOBuffer* buf, |
| 85 int buf_len, | 81 int buf_len, |
| 86 OldCompletionCallback* callback) OVERRIDE; | 82 const CompletionCallback& callback) OVERRIDE; |
| 87 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 83 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 88 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 84 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 89 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; | 85 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; |
| 90 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; | 86 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
| 91 | 87 |
| 92 // SpdyStream::Delegate implementation. | 88 // SpdyStream::Delegate implementation. |
| 93 virtual bool OnSendHeadersComplete(int status) OVERRIDE; | 89 virtual bool OnSendHeadersComplete(int status) OVERRIDE; |
| 94 virtual int OnSendBody() OVERRIDE; | 90 virtual int OnSendBody() OVERRIDE; |
| 95 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; | 91 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; |
| 96 virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, | 92 virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 127 int PopulateUserReadBuffer(); | 123 int PopulateUserReadBuffer(); |
| 128 | 124 |
| 129 OldCompletionCallbackImpl<SpdyProxyClientSocket> io_callback_; | 125 OldCompletionCallbackImpl<SpdyProxyClientSocket> io_callback_; |
| 130 State next_state_; | 126 State next_state_; |
| 131 | 127 |
| 132 // Pointer to the SPDY Stream that this sits on top of. | 128 // Pointer to the SPDY Stream that this sits on top of. |
| 133 scoped_refptr<SpdyStream> spdy_stream_; | 129 scoped_refptr<SpdyStream> spdy_stream_; |
| 134 | 130 |
| 135 // Stores the callback to the layer above, called on completing Read() or | 131 // Stores the callback to the layer above, called on completing Read() or |
| 136 // Connect(). | 132 // Connect(). |
| 137 OldCompletionCallback* old_read_callback_; | |
| 138 CompletionCallback read_callback_; | 133 CompletionCallback read_callback_; |
| 139 // Stores the callback to the layer above, called on completing Write(). | 134 // Stores the callback to the layer above, called on completing Write(). |
| 140 OldCompletionCallback* write_callback_; | 135 CompletionCallback write_callback_; |
| 141 | 136 |
| 142 // CONNECT request and response. | 137 // CONNECT request and response. |
| 143 HttpRequestInfo request_; | 138 HttpRequestInfo request_; |
| 144 HttpResponseInfo response_; | 139 HttpResponseInfo response_; |
| 145 | 140 |
| 146 // The hostname and port of the endpoint. This is not necessarily the one | 141 // The hostname and port of the endpoint. This is not necessarily the one |
| 147 // specified by the URL, due to Alternate-Protocol or fixed testing ports. | 142 // specified by the URL, due to Alternate-Protocol or fixed testing ports. |
| 148 const HostPortPair endpoint_; | 143 const HostPortPair endpoint_; |
| 149 scoped_refptr<HttpAuthController> auth_; | 144 scoped_refptr<HttpAuthController> auth_; |
| 150 | 145 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 167 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; | 162 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; |
| 168 | 163 |
| 169 const BoundNetLog net_log_; | 164 const BoundNetLog net_log_; |
| 170 | 165 |
| 171 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); | 166 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); |
| 172 }; | 167 }; |
| 173 | 168 |
| 174 } // namespace net | 169 } // namespace net |
| 175 | 170 |
| 176 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ | 171 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ |
| OLD | NEW |