OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 virtual uint64 GetUploadProgress() const; | 84 virtual uint64 GetUploadProgress() const; |
85 | 85 |
86 private: | 86 private: |
87 FRIEND_TEST(HttpNetworkTransactionTest, ResetStateForRestart); | 87 FRIEND_TEST(HttpNetworkTransactionTest, ResetStateForRestart); |
88 | 88 |
89 enum State { | 89 enum State { |
90 STATE_RESOLVE_PROXY, | 90 STATE_RESOLVE_PROXY, |
91 STATE_RESOLVE_PROXY_COMPLETE, | 91 STATE_RESOLVE_PROXY_COMPLETE, |
92 STATE_INIT_CONNECTION, | 92 STATE_INIT_CONNECTION, |
93 STATE_INIT_CONNECTION_COMPLETE, | 93 STATE_INIT_CONNECTION_COMPLETE, |
94 STATE_RESTART_TUNNEL_AUTH, | |
95 STATE_RESTART_TUNNEL_AUTH_COMPLETE, | |
94 STATE_GENERATE_PROXY_AUTH_TOKEN, | 96 STATE_GENERATE_PROXY_AUTH_TOKEN, |
95 STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE, | 97 STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE, |
96 STATE_GENERATE_SERVER_AUTH_TOKEN, | 98 STATE_GENERATE_SERVER_AUTH_TOKEN, |
97 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, | 99 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, |
98 STATE_SEND_REQUEST, | 100 STATE_SEND_REQUEST, |
99 STATE_SEND_REQUEST_COMPLETE, | 101 STATE_SEND_REQUEST_COMPLETE, |
100 STATE_READ_HEADERS, | 102 STATE_READ_HEADERS, |
101 STATE_READ_HEADERS_COMPLETE, | 103 STATE_READ_HEADERS_COMPLETE, |
102 STATE_READ_BODY, | 104 STATE_READ_BODY, |
103 STATE_READ_BODY_COMPLETE, | 105 STATE_READ_BODY_COMPLETE, |
(...skipping 23 matching lines...) Expand all Loading... | |
127 int DoLoop(int result); | 129 int DoLoop(int result); |
128 | 130 |
129 // Each of these methods corresponds to a State value. Those with an input | 131 // Each of these methods corresponds to a State value. Those with an input |
130 // argument receive the result from the previous state. If a method returns | 132 // argument receive the result from the previous state. If a method returns |
131 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the | 133 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the |
132 // next state method as the result arg. | 134 // next state method as the result arg. |
133 int DoResolveProxy(); | 135 int DoResolveProxy(); |
134 int DoResolveProxyComplete(int result); | 136 int DoResolveProxyComplete(int result); |
135 int DoInitConnection(); | 137 int DoInitConnection(); |
136 int DoInitConnectionComplete(int result); | 138 int DoInitConnectionComplete(int result); |
139 int DoRestartTunnelAuth(); | |
140 int DoRestartTunnelAuthComplete(int result); | |
137 int DoGenerateProxyAuthToken(); | 141 int DoGenerateProxyAuthToken(); |
138 int DoGenerateProxyAuthTokenComplete(int result); | 142 int DoGenerateProxyAuthTokenComplete(int result); |
139 int DoGenerateServerAuthToken(); | 143 int DoGenerateServerAuthToken(); |
140 int DoGenerateServerAuthTokenComplete(int result); | 144 int DoGenerateServerAuthTokenComplete(int result); |
141 int DoSendRequest(); | 145 int DoSendRequest(); |
142 int DoSendRequestComplete(int result); | 146 int DoSendRequestComplete(int result); |
143 int DoReadHeaders(); | 147 int DoReadHeaders(); |
144 int DoReadHeadersComplete(int result); | 148 int DoReadHeadersComplete(int result); |
145 int DoReadBody(); | 149 int DoReadBody(); |
146 int DoReadBodyComplete(int result); | 150 int DoReadBodyComplete(int result); |
(...skipping 16 matching lines...) Expand all Loading... | |
163 | 167 |
164 // Record histogram of latency (durations until last byte received). | 168 // Record histogram of latency (durations until last byte received). |
165 void LogTransactionMetrics() const; | 169 void LogTransactionMetrics() const; |
166 | 170 |
167 // Writes a log message to help debugging in the field when we block a proxy | 171 // Writes a log message to help debugging in the field when we block a proxy |
168 // response to a CONNECT request. | 172 // response to a CONNECT request. |
169 void LogBlockedTunnelResponse(int response_code) const; | 173 void LogBlockedTunnelResponse(int response_code) const; |
170 | 174 |
171 static void LogIOErrorMetrics(const ClientSocketHandle& handle); | 175 static void LogIOErrorMetrics(const ClientSocketHandle& handle); |
172 | 176 |
177 // Called to handle an http proxy tunnel request for auth | |
eroman
2010/07/30 22:11:11
nit: end with period. also "http" --> "HTTP".
| |
178 int HandleTunnelAuthFailure(int error); | |
179 | |
173 // Called to handle a certificate error. Returns OK if the error should be | 180 // Called to handle a certificate error. Returns OK if the error should be |
174 // ignored. Otherwise, stores the certificate in response_.ssl_info and | 181 // ignored. Otherwise, stores the certificate in response_.ssl_info and |
175 // returns the same error code. | 182 // returns the same error code. |
176 int HandleCertificateError(int error); | 183 int HandleCertificateError(int error); |
177 | 184 |
178 // Called to handle a client certificate request. | 185 // Called to handle a client certificate request. |
179 int HandleCertificateRequest(int error); | 186 int HandleCertificateRequest(int error); |
180 | 187 |
181 // Called to possibly recover from an SSL handshake error. Sets next_state_ | 188 // Called to possibly recover from an SSL handshake error. Sets next_state_ |
182 // and returns OK if recovering from the error. Otherwise, the same error | 189 // and returns OK if recovering from the error. Otherwise, the same error |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 // True when the tunnel is in the process of being established - we can't | 336 // True when the tunnel is in the process of being established - we can't |
330 // read from the socket until the tunnel is done. | 337 // read from the socket until the tunnel is done. |
331 bool establishing_tunnel_; | 338 bool establishing_tunnel_; |
332 | 339 |
333 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); | 340 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); |
334 }; | 341 }; |
335 | 342 |
336 } // namespace net | 343 } // namespace net |
337 | 344 |
338 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 345 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
OLD | NEW |