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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 STATE_GENERATE_AUTH_TOKEN_COMPLETE, | 106 STATE_GENERATE_AUTH_TOKEN_COMPLETE, |
107 STATE_SEND_REQUEST, | 107 STATE_SEND_REQUEST, |
108 STATE_SEND_REQUEST_COMPLETE, | 108 STATE_SEND_REQUEST_COMPLETE, |
109 STATE_READ_REPLY_COMPLETE, | 109 STATE_READ_REPLY_COMPLETE, |
110 STATE_OPEN, | 110 STATE_OPEN, |
111 STATE_CLOSED | 111 STATE_CLOSED |
112 }; | 112 }; |
113 | 113 |
114 void LogBlockedTunnelResponse() const; | 114 void LogBlockedTunnelResponse() const; |
115 | 115 |
| 116 // Calls |callback.Run(result)|. Used to post a callback for the message |
| 117 // loop to run later. |
| 118 void RunCallback(const CompletionCallback& callback, int result) const; |
| 119 |
116 void OnIOComplete(int result); | 120 void OnIOComplete(int result); |
117 | 121 |
118 int DoLoop(int last_io_result); | 122 int DoLoop(int last_io_result); |
119 int DoGenerateAuthToken(); | 123 int DoGenerateAuthToken(); |
120 int DoGenerateAuthTokenComplete(int result); | 124 int DoGenerateAuthTokenComplete(int result); |
121 int DoSendRequest(); | 125 int DoSendRequest(); |
122 int DoSendRequestComplete(int result); | 126 int DoSendRequestComplete(int result); |
123 int DoReadReplyComplete(int result); | 127 int DoReadReplyComplete(int result); |
124 | 128 |
125 // Populates |user_buffer_| with as much read data as possible | 129 // Populates |user_buffer_| with as much read data as possible |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 162 |
159 // True if the transport socket has ever sent data. | 163 // True if the transport socket has ever sent data. |
160 bool was_ever_used_; | 164 bool was_ever_used_; |
161 | 165 |
162 // Used only for redirects. | 166 // Used only for redirects. |
163 bool redirect_has_load_timing_info_; | 167 bool redirect_has_load_timing_info_; |
164 LoadTimingInfo redirect_load_timing_info_; | 168 LoadTimingInfo redirect_load_timing_info_; |
165 | 169 |
166 const BoundNetLog net_log_; | 170 const BoundNetLog net_log_; |
167 | 171 |
| 172 // The default weak pointer factory. |
168 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; | 173 base::WeakPtrFactory<SpdyProxyClientSocket> weak_factory_; |
169 | 174 |
| 175 // Only used for posting write callbacks. Weak pointers created by this |
| 176 // factory are invalidated in Disconnect(). |
| 177 base::WeakPtrFactory<SpdyProxyClientSocket> write_callback_weak_factory_; |
| 178 |
170 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); | 179 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); |
171 }; | 180 }; |
172 | 181 |
173 } // namespace net | 182 } // namespace net |
174 | 183 |
175 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ | 184 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ |
OLD | NEW |