| 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_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 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 STATE_GENERATE_SERVER_AUTH_TOKEN, | 138 STATE_GENERATE_SERVER_AUTH_TOKEN, |
| 139 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, | 139 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, |
| 140 STATE_INIT_REQUEST_BODY, | 140 STATE_INIT_REQUEST_BODY, |
| 141 STATE_INIT_REQUEST_BODY_COMPLETE, | 141 STATE_INIT_REQUEST_BODY_COMPLETE, |
| 142 STATE_BUILD_REQUEST, | 142 STATE_BUILD_REQUEST, |
| 143 STATE_BUILD_REQUEST_COMPLETE, | 143 STATE_BUILD_REQUEST_COMPLETE, |
| 144 STATE_SEND_REQUEST, | 144 STATE_SEND_REQUEST, |
| 145 STATE_SEND_REQUEST_COMPLETE, | 145 STATE_SEND_REQUEST_COMPLETE, |
| 146 STATE_READ_HEADERS, | 146 STATE_READ_HEADERS, |
| 147 STATE_READ_HEADERS_COMPLETE, | 147 STATE_READ_HEADERS_COMPLETE, |
| 148 STATE_HANDLE_AUTH_CHALLENGE, |
| 149 STATE_HANDLE_AUTH_CHALLENGE_COMPLETE, |
| 148 STATE_READ_BODY, | 150 STATE_READ_BODY, |
| 149 STATE_READ_BODY_COMPLETE, | 151 STATE_READ_BODY_COMPLETE, |
| 150 STATE_DRAIN_BODY_FOR_AUTH_RESTART, | 152 STATE_DRAIN_BODY_FOR_AUTH_RESTART, |
| 151 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, | 153 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, |
| 152 STATE_NONE | 154 STATE_NONE |
| 153 }; | 155 }; |
| 154 | 156 |
| 155 bool IsSecureRequest() const; | 157 bool IsSecureRequest() const; |
| 156 | 158 |
| 157 // Returns true if the request is using an HTTP(S) proxy without being | 159 // Returns true if the request is using an HTTP(S) proxy without being |
| (...skipping 20 matching lines...) Expand all Loading... |
| 178 int DoGenerateServerAuthToken(); | 180 int DoGenerateServerAuthToken(); |
| 179 int DoGenerateServerAuthTokenComplete(int result); | 181 int DoGenerateServerAuthTokenComplete(int result); |
| 180 int DoInitRequestBody(); | 182 int DoInitRequestBody(); |
| 181 int DoInitRequestBodyComplete(int result); | 183 int DoInitRequestBodyComplete(int result); |
| 182 int DoBuildRequest(); | 184 int DoBuildRequest(); |
| 183 int DoBuildRequestComplete(int result); | 185 int DoBuildRequestComplete(int result); |
| 184 int DoSendRequest(); | 186 int DoSendRequest(); |
| 185 int DoSendRequestComplete(int result); | 187 int DoSendRequestComplete(int result); |
| 186 int DoReadHeaders(); | 188 int DoReadHeaders(); |
| 187 int DoReadHeadersComplete(int result); | 189 int DoReadHeadersComplete(int result); |
| 190 int DoHandleAuthChallenge(); |
| 191 int DoHandleAuthChallengeComplete(int result); |
| 188 int DoReadBody(); | 192 int DoReadBody(); |
| 189 int DoReadBodyComplete(int result); | 193 int DoReadBodyComplete(int result); |
| 190 int DoDrainBodyForAuthRestart(); | 194 int DoDrainBodyForAuthRestart(); |
| 191 int DoDrainBodyForAuthRestartComplete(int result); | 195 int DoDrainBodyForAuthRestartComplete(int result); |
| 192 | 196 |
| 193 void BuildRequestHeaders(bool using_http_proxy_without_tunnel); | 197 void BuildRequestHeaders(bool using_http_proxy_without_tunnel); |
| 194 | 198 |
| 195 // Writes a log message to help debugging in the field when we block a proxy | 199 // Writes a log message to help debugging in the field when we block a proxy |
| 196 // response to a CONNECT request. | 200 // response to a CONNECT request. |
| 197 void LogBlockedTunnelResponse(int response_code) const; | 201 void LogBlockedTunnelResponse(int response_code) const; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 248 |
| 245 // Records metrics relating to SSL fallbacks. | 249 // Records metrics relating to SSL fallbacks. |
| 246 void RecordSSLFallbackMetrics(int result); | 250 void RecordSSLFallbackMetrics(int result); |
| 247 | 251 |
| 248 // Returns true if we should try to add a Proxy-Authorization header | 252 // Returns true if we should try to add a Proxy-Authorization header |
| 249 bool ShouldApplyProxyAuth() const; | 253 bool ShouldApplyProxyAuth() const; |
| 250 | 254 |
| 251 // Returns true if we should try to add an Authorization header. | 255 // Returns true if we should try to add an Authorization header. |
| 252 bool ShouldApplyServerAuth() const; | 256 bool ShouldApplyServerAuth() const; |
| 253 | 257 |
| 254 // Handles HTTP status code 401 or 407. | |
| 255 // HandleAuthChallenge() returns a network error code, or OK on success. | |
| 256 // May update |pending_auth_target_| or |response_.auth_challenge|. | |
| 257 int HandleAuthChallenge(); | |
| 258 | |
| 259 // Returns true if we have auth credentials for the given target. | 258 // Returns true if we have auth credentials for the given target. |
| 260 bool HaveAuth(HttpAuth::Target target) const; | 259 bool HaveAuth(HttpAuth::Target target) const; |
| 261 | 260 |
| 262 // Get the {scheme, host, path, port} for the authentication target | 261 // Get the {scheme, host, path, port} for the authentication target |
| 263 GURL AuthURL(HttpAuth::Target target) const; | 262 GURL AuthURL(HttpAuth::Target target) const; |
| 264 | 263 |
| 265 // Returns true if this transaction is for a WebSocket handshake | 264 // Returns true if this transaction is for a WebSocket handshake |
| 266 bool ForWebSocketHandshake() const; | 265 bool ForWebSocketHandshake() const; |
| 267 | 266 |
| 268 // Debug helper. | 267 // Debug helper. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 352 |
| 354 ConnectionAttempts connection_attempts_; | 353 ConnectionAttempts connection_attempts_; |
| 355 IPEndPoint remote_endpoint_; | 354 IPEndPoint remote_endpoint_; |
| 356 | 355 |
| 357 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); | 356 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); |
| 358 }; | 357 }; |
| 359 | 358 |
| 360 } // namespace net | 359 } // namespace net |
| 361 | 360 |
| 362 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 361 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| OLD | NEW |