| 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_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 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 public SpdyStream::Delegate { | 40 public SpdyStream::Delegate { |
| 41 public: | 41 public: |
| 42 // Create a socket on top of the |spdy_stream| by sending a HEADERS CONNECT | 42 // Create a socket on top of the |spdy_stream| by sending a HEADERS CONNECT |
| 43 // frame for |endpoint|. After the response HEADERS frame is received, any | 43 // frame for |endpoint|. After the response HEADERS frame is received, any |
| 44 // data read/written to the socket will be transferred in data frames. This | 44 // data read/written to the socket will be transferred in data frames. This |
| 45 // object will set itself as |spdy_stream|'s delegate. | 45 // object will set itself as |spdy_stream|'s delegate. |
| 46 SpdyProxyClientSocket(const base::WeakPtr<SpdyStream>& spdy_stream, | 46 SpdyProxyClientSocket(const base::WeakPtr<SpdyStream>& spdy_stream, |
| 47 const std::string& user_agent, | 47 const std::string& user_agent, |
| 48 const HostPortPair& endpoint, | 48 const HostPortPair& endpoint, |
| 49 const HostPortPair& proxy_server, | 49 const HostPortPair& proxy_server, |
| 50 const BoundNetLog& source_net_log, | 50 const NetLogWithSource& source_net_log, |
| 51 HttpAuthController* auth_controller); | 51 HttpAuthController* auth_controller); |
| 52 | 52 |
| 53 // On destruction Disconnect() is called. | 53 // On destruction Disconnect() is called. |
| 54 ~SpdyProxyClientSocket() override; | 54 ~SpdyProxyClientSocket() override; |
| 55 | 55 |
| 56 // ProxyClientSocket methods: | 56 // ProxyClientSocket methods: |
| 57 const HttpResponseInfo* GetConnectResponseInfo() const override; | 57 const HttpResponseInfo* GetConnectResponseInfo() const override; |
| 58 HttpStream* CreateConnectResponseStream() override; | 58 HttpStream* CreateConnectResponseStream() override; |
| 59 const scoped_refptr<HttpAuthController>& GetAuthController() const override; | 59 const scoped_refptr<HttpAuthController>& GetAuthController() const override; |
| 60 int RestartWithAuth(const CompletionCallback& callback) override; | 60 int RestartWithAuth(const CompletionCallback& callback) override; |
| 61 bool IsUsingSpdy() const override; | 61 bool IsUsingSpdy() const override; |
| 62 NextProto GetProxyNegotiatedProtocol() const override; | 62 NextProto GetProxyNegotiatedProtocol() const override; |
| 63 | 63 |
| 64 // StreamSocket implementation. | 64 // StreamSocket implementation. |
| 65 int Connect(const CompletionCallback& callback) override; | 65 int Connect(const CompletionCallback& callback) override; |
| 66 void Disconnect() override; | 66 void Disconnect() override; |
| 67 bool IsConnected() const override; | 67 bool IsConnected() const override; |
| 68 bool IsConnectedAndIdle() const override; | 68 bool IsConnectedAndIdle() const override; |
| 69 const BoundNetLog& NetLog() const override; | 69 const NetLogWithSource& NetLog() const override; |
| 70 void SetSubresourceSpeculation() override; | 70 void SetSubresourceSpeculation() override; |
| 71 void SetOmniboxSpeculation() override; | 71 void SetOmniboxSpeculation() override; |
| 72 bool WasEverUsed() const override; | 72 bool WasEverUsed() const override; |
| 73 bool WasNpnNegotiated() const override; | 73 bool WasNpnNegotiated() const override; |
| 74 NextProto GetNegotiatedProtocol() const override; | 74 NextProto GetNegotiatedProtocol() const override; |
| 75 bool GetSSLInfo(SSLInfo* ssl_info) override; | 75 bool GetSSLInfo(SSLInfo* ssl_info) override; |
| 76 void GetConnectionAttempts(ConnectionAttempts* out) const override; | 76 void GetConnectionAttempts(ConnectionAttempts* out) const override; |
| 77 void ClearConnectionAttempts() override {} | 77 void ClearConnectionAttempts() override {} |
| 78 void AddConnectionAttempts(const ConnectionAttempts& attempts) override {} | 78 void AddConnectionAttempts(const ConnectionAttempts& attempts) override {} |
| 79 int64_t GetTotalReceivedBytes() const override; | 79 int64_t GetTotalReceivedBytes() const override; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // User specified number of bytes to be written. | 162 // User specified number of bytes to be written. |
| 163 int write_buffer_len_; | 163 int write_buffer_len_; |
| 164 | 164 |
| 165 // True if the transport socket has ever sent data. | 165 // True if the transport socket has ever sent data. |
| 166 bool was_ever_used_; | 166 bool was_ever_used_; |
| 167 | 167 |
| 168 // Used only for redirects. | 168 // Used only for redirects. |
| 169 bool redirect_has_load_timing_info_; | 169 bool redirect_has_load_timing_info_; |
| 170 LoadTimingInfo redirect_load_timing_info_; | 170 LoadTimingInfo redirect_load_timing_info_; |
| 171 | 171 |
| 172 const BoundNetLog net_log_; | 172 const NetLogWithSource net_log_; |
| 173 | 173 |
| 174 // The default weak pointer factory. | 174 // The default weak pointer factory. |
| 175 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; | 175 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; |
| 176 | 176 |
| 177 // Only used for posting write callbacks. Weak pointers created by this | 177 // Only used for posting write callbacks. Weak pointers created by this |
| 178 // factory are invalidated in Disconnect(). | 178 // factory are invalidated in Disconnect(). |
| 179 base::WeakPtrFactory<SpdyProxyClientSocket> write_callback_weak_factory_; | 179 base::WeakPtrFactory<SpdyProxyClientSocket> write_callback_weak_factory_; |
| 180 | 180 |
| 181 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); | 181 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 } // namespace net | 184 } // namespace net |
| 185 | 185 |
| 186 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ | 186 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ |
| OLD | NEW |