| 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 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "net/base/completion_callback.h" | 17 #include "net/base/completion_callback.h" |
| 18 #include "net/base/host_port_pair.h" | 18 #include "net/base/host_port_pair.h" |
| 19 #include "net/base/load_timing_info.h" | 19 #include "net/base/load_timing_info.h" |
| 20 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
| 21 #include "net/http/http_auth_controller.h" | 21 #include "net/http/http_auth_controller.h" |
| 22 #include "net/http/http_request_headers.h" | 22 #include "net/http/http_request_headers.h" |
| 23 #include "net/http/http_request_info.h" | 23 #include "net/http/http_request_info.h" |
| 24 #include "net/http/http_response_info.h" | 24 #include "net/http/http_response_info.h" |
| 25 #include "net/http/proxy_client_socket.h" | 25 #include "net/http/proxy_client_socket.h" |
| 26 #include "net/log/net_log_source.h" |
| 26 #include "net/log/net_log_with_source.h" | 27 #include "net/log/net_log_with_source.h" |
| 27 #include "net/spdy/spdy_http_stream.h" | 28 #include "net/spdy/spdy_http_stream.h" |
| 28 #include "net/spdy/spdy_protocol.h" | 29 #include "net/spdy/spdy_protocol.h" |
| 29 #include "net/spdy/spdy_read_queue.h" | 30 #include "net/spdy/spdy_read_queue.h" |
| 30 #include "net/spdy/spdy_session.h" | 31 #include "net/spdy/spdy_session.h" |
| 31 #include "net/spdy/spdy_stream.h" | 32 #include "net/spdy/spdy_stream.h" |
| 32 | 33 |
| 33 namespace net { | 34 namespace net { |
| 34 | 35 |
| 35 class HttpStream; | 36 class HttpStream; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 int GetPeerAddress(IPEndPoint* address) const override; | 91 int GetPeerAddress(IPEndPoint* address) const override; |
| 91 int GetLocalAddress(IPEndPoint* address) const override; | 92 int GetLocalAddress(IPEndPoint* address) const override; |
| 92 | 93 |
| 93 // SpdyStream::Delegate implementation. | 94 // SpdyStream::Delegate implementation. |
| 94 void OnHeadersSent() override; | 95 void OnHeadersSent() override; |
| 95 void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; | 96 void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; |
| 96 void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; | 97 void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; |
| 97 void OnDataSent() override; | 98 void OnDataSent() override; |
| 98 void OnTrailers(const SpdyHeaderBlock& trailers) override; | 99 void OnTrailers(const SpdyHeaderBlock& trailers) override; |
| 99 void OnClose(int status) override; | 100 void OnClose(int status) override; |
| 101 NetLogSource source_dependency() const override; |
| 100 | 102 |
| 101 private: | 103 private: |
| 102 enum State { | 104 enum State { |
| 103 STATE_DISCONNECTED, | 105 STATE_DISCONNECTED, |
| 104 STATE_GENERATE_AUTH_TOKEN, | 106 STATE_GENERATE_AUTH_TOKEN, |
| 105 STATE_GENERATE_AUTH_TOKEN_COMPLETE, | 107 STATE_GENERATE_AUTH_TOKEN_COMPLETE, |
| 106 STATE_SEND_REQUEST, | 108 STATE_SEND_REQUEST, |
| 107 STATE_SEND_REQUEST_COMPLETE, | 109 STATE_SEND_REQUEST_COMPLETE, |
| 108 STATE_READ_REPLY_COMPLETE, | 110 STATE_READ_REPLY_COMPLETE, |
| 109 STATE_OPEN, | 111 STATE_OPEN, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 int write_buffer_len_; | 164 int write_buffer_len_; |
| 163 | 165 |
| 164 // True if the transport socket has ever sent data. | 166 // True if the transport socket has ever sent data. |
| 165 bool was_ever_used_; | 167 bool was_ever_used_; |
| 166 | 168 |
| 167 // Used only for redirects. | 169 // Used only for redirects. |
| 168 bool redirect_has_load_timing_info_; | 170 bool redirect_has_load_timing_info_; |
| 169 LoadTimingInfo redirect_load_timing_info_; | 171 LoadTimingInfo redirect_load_timing_info_; |
| 170 | 172 |
| 171 const NetLogWithSource net_log_; | 173 const NetLogWithSource net_log_; |
| 174 const NetLogSource source_dependency_; |
| 172 | 175 |
| 173 // The default weak pointer factory. | 176 // The default weak pointer factory. |
| 174 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; | 177 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; |
| 175 | 178 |
| 176 // Only used for posting write callbacks. Weak pointers created by this | 179 // Only used for posting write callbacks. Weak pointers created by this |
| 177 // factory are invalidated in Disconnect(). | 180 // factory are invalidated in Disconnect(). |
| 178 base::WeakPtrFactory<SpdyProxyClientSocket> write_callback_weak_factory_; | 181 base::WeakPtrFactory<SpdyProxyClientSocket> write_callback_weak_factory_; |
| 179 | 182 |
| 180 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); | 183 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); |
| 181 }; | 184 }; |
| 182 | 185 |
| 183 } // namespace net | 186 } // namespace net |
| 184 | 187 |
| 185 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ | 188 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ |
| OLD | NEW |