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 <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const std::string& user_agent, | 47 const std::string& user_agent, |
48 const HostPortPair& endpoint, | 48 const HostPortPair& endpoint, |
49 const GURL& url, | 49 const GURL& url, |
50 const HostPortPair& proxy_server, | 50 const HostPortPair& proxy_server, |
51 const BoundNetLog& source_net_log, | 51 const BoundNetLog& source_net_log, |
52 HttpAuthCache* auth_cache, | 52 HttpAuthCache* auth_cache, |
53 HttpAuthHandlerFactory* auth_handler_factory); | 53 HttpAuthHandlerFactory* auth_handler_factory); |
54 | 54 |
55 | 55 |
56 // On destruction Disconnect() is called. | 56 // On destruction Disconnect() is called. |
57 virtual ~SpdyProxyClientSocket(); | 57 ~SpdyProxyClientSocket() override; |
58 | 58 |
59 // ProxyClientSocket methods: | 59 // ProxyClientSocket methods: |
60 virtual const HttpResponseInfo* GetConnectResponseInfo() const override; | 60 const HttpResponseInfo* GetConnectResponseInfo() const override; |
61 virtual HttpStream* CreateConnectResponseStream() override; | 61 HttpStream* CreateConnectResponseStream() override; |
62 virtual const scoped_refptr<HttpAuthController>& GetAuthController() const | 62 const scoped_refptr<HttpAuthController>& GetAuthController() const override; |
63 override; | 63 int RestartWithAuth(const CompletionCallback& callback) override; |
64 virtual int RestartWithAuth(const CompletionCallback& callback) override; | 64 bool IsUsingSpdy() const override; |
65 virtual bool IsUsingSpdy() const override; | 65 NextProto GetProtocolNegotiated() const override; |
66 virtual NextProto GetProtocolNegotiated() const override; | |
67 | 66 |
68 // StreamSocket implementation. | 67 // StreamSocket implementation. |
69 virtual int Connect(const CompletionCallback& callback) override; | 68 int Connect(const CompletionCallback& callback) override; |
70 virtual void Disconnect() override; | 69 void Disconnect() override; |
71 virtual bool IsConnected() const override; | 70 bool IsConnected() const override; |
72 virtual bool IsConnectedAndIdle() const override; | 71 bool IsConnectedAndIdle() const override; |
73 virtual const BoundNetLog& NetLog() const override; | 72 const BoundNetLog& NetLog() const override; |
74 virtual void SetSubresourceSpeculation() override; | 73 void SetSubresourceSpeculation() override; |
75 virtual void SetOmniboxSpeculation() override; | 74 void SetOmniboxSpeculation() override; |
76 virtual bool WasEverUsed() const override; | 75 bool WasEverUsed() const override; |
77 virtual bool UsingTCPFastOpen() const override; | 76 bool UsingTCPFastOpen() const override; |
78 virtual bool WasNpnNegotiated() const override; | 77 bool WasNpnNegotiated() const override; |
79 virtual NextProto GetNegotiatedProtocol() const override; | 78 NextProto GetNegotiatedProtocol() const override; |
80 virtual bool GetSSLInfo(SSLInfo* ssl_info) override; | 79 bool GetSSLInfo(SSLInfo* ssl_info) override; |
81 | 80 |
82 // Socket implementation. | 81 // Socket implementation. |
83 virtual int Read(IOBuffer* buf, | 82 int Read(IOBuffer* buf, |
84 int buf_len, | 83 int buf_len, |
85 const CompletionCallback& callback) override; | 84 const CompletionCallback& callback) override; |
86 virtual int Write(IOBuffer* buf, | 85 int Write(IOBuffer* buf, |
87 int buf_len, | 86 int buf_len, |
88 const CompletionCallback& callback) override; | 87 const CompletionCallback& callback) override; |
89 virtual int SetReceiveBufferSize(int32 size) override; | 88 int SetReceiveBufferSize(int32 size) override; |
90 virtual int SetSendBufferSize(int32 size) override; | 89 int SetSendBufferSize(int32 size) override; |
91 virtual int GetPeerAddress(IPEndPoint* address) const override; | 90 int GetPeerAddress(IPEndPoint* address) const override; |
92 virtual int GetLocalAddress(IPEndPoint* address) const override; | 91 int GetLocalAddress(IPEndPoint* address) const override; |
93 | 92 |
94 // SpdyStream::Delegate implementation. | 93 // SpdyStream::Delegate implementation. |
95 virtual void OnRequestHeadersSent() override; | 94 void OnRequestHeadersSent() override; |
96 virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated( | 95 SpdyResponseHeadersStatus OnResponseHeadersUpdated( |
97 const SpdyHeaderBlock& response_headers) override; | 96 const SpdyHeaderBlock& response_headers) override; |
98 virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override; | 97 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override; |
99 virtual void OnDataSent() override; | 98 void OnDataSent() override; |
100 virtual void OnClose(int status) override; | 99 void OnClose(int status) override; |
101 | 100 |
102 private: | 101 private: |
103 enum State { | 102 enum State { |
104 STATE_DISCONNECTED, | 103 STATE_DISCONNECTED, |
105 STATE_GENERATE_AUTH_TOKEN, | 104 STATE_GENERATE_AUTH_TOKEN, |
106 STATE_GENERATE_AUTH_TOKEN_COMPLETE, | 105 STATE_GENERATE_AUTH_TOKEN_COMPLETE, |
107 STATE_SEND_REQUEST, | 106 STATE_SEND_REQUEST, |
108 STATE_SEND_REQUEST_COMPLETE, | 107 STATE_SEND_REQUEST_COMPLETE, |
109 STATE_READ_REPLY_COMPLETE, | 108 STATE_READ_REPLY_COMPLETE, |
110 STATE_OPEN, | 109 STATE_OPEN, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Only used for posting write callbacks. Weak pointers created by this | 174 // Only used for posting write callbacks. Weak pointers created by this |
176 // factory are invalidated in Disconnect(). | 175 // factory are invalidated in Disconnect(). |
177 base::WeakPtrFactory<SpdyProxyClientSocket> write_callback_weak_factory_; | 176 base::WeakPtrFactory<SpdyProxyClientSocket> write_callback_weak_factory_; |
178 | 177 |
179 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); | 178 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); |
180 }; | 179 }; |
181 | 180 |
182 } // namespace net | 181 } // namespace net |
183 | 182 |
184 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ | 183 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ |
OLD | NEW |