summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_transaction.h
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 19:25:04 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 19:25:04 +0000
commit8a1f331497a81bb929ab75a3cfc8b1b835e21bcd (patch)
treee608c6f36c92c0446ebf01899920d2b7d66f619f /net/http/http_network_transaction.h
parent6b8ab84aa5133fdb73add7ba1771559cbc3ffd4c (diff)
downloadchromium_src-8a1f331497a81bb929ab75a3cfc8b1b835e21bcd.zip
chromium_src-8a1f331497a81bb929ab75a3cfc8b1b835e21bcd.tar.gz
chromium_src-8a1f331497a81bb929ab75a3cfc8b1b835e21bcd.tar.bz2
Eliminate the establishing_tunnel_ internal state and move to explicit
states in the state machine for proxy tunnel establishment. Original work from svandebo. BUG=none TEST=existing Review URL: http://codereview.chromium.org/2101014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48173 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction.h')
-rw-r--r--net/http/http_network_transaction.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h
index d9fed35..bf945fa 100644
--- a/net/http/http_network_transaction.h
+++ b/net/http/http_network_transaction.h
@@ -83,6 +83,10 @@ class HttpNetworkTransaction : public HttpTransaction {
STATE_RESOLVE_PROXY_COMPLETE,
STATE_INIT_CONNECTION,
STATE_INIT_CONNECTION_COMPLETE,
+ STATE_TUNNEL_SEND_REQUEST,
+ STATE_TUNNEL_SEND_REQUEST_COMPLETE,
+ STATE_TUNNEL_READ_HEADERS,
+ STATE_TUNNEL_READ_HEADERS_COMPLETE,
STATE_SSL_CONNECT,
STATE_SSL_CONNECT_COMPLETE,
STATE_SEND_REQUEST,
@@ -124,6 +128,10 @@ class HttpNetworkTransaction : public HttpTransaction {
int DoResolveProxyComplete(int result);
int DoInitConnection();
int DoInitConnectionComplete(int result);
+ int DoTunnelSendRequest();
+ int DoTunnelSendRequestComplete(int result);
+ int DoTunnelReadHeaders();
+ int DoTunnelReadHeadersComplete(int result);
int DoSSLConnect();
int DoSSLConnectComplete(int result);
int DoSendRequest();
@@ -211,6 +219,9 @@ class HttpNetworkTransaction : public HttpTransaction {
// Resets the members of the transaction so it can be restarted.
void ResetStateForRestart();
+ // Clear the state used to setup the tunnel.
+ void ClearTunnelState();
+
// Returns true if we should try to add a Proxy-Authorization header
bool ShouldApplyProxyAuth() const;
@@ -229,7 +240,7 @@ class HttpNetworkTransaction : public HttpTransaction {
// Handles HTTP status code 401 or 407.
// HandleAuthChallenge() returns a network error code, or OK on success.
// May update |pending_auth_target_| or |response_.auth_challenge|.
- int HandleAuthChallenge();
+ int HandleAuthChallenge(bool establishing_tunnel);
// Populates response_.auth_challenge with the challenge information, so that
// URLRequestHttpJob can prompt for a username/password.
@@ -322,13 +333,6 @@ class HttpNetworkTransaction : public HttpTransaction {
bool using_ssl_; // True if handling a HTTPS request
- // True while establishing a tunnel. This allows the HTTP CONNECT
- // request/response to reuse the STATE_SEND_REQUEST,
- // STATE_SEND_REQUEST_COMPLETE, STATE_READ_HEADERS, and
- // STATE_READ_HEADERS_COMPLETE states and allows us to tell them apart from
- // the real request/response of the transaction.
- bool establishing_tunnel_;
-
// True if this network transaction is using SPDY instead of HTTP.
bool using_spdy_;