Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Unified Diff: net/http/http_network_transaction.h

Issue 100001: Refactor HttpNetworkTransaction to remove side effects in some member functions. (Closed)
Patch Set: Use request_headers directly instead of swapping. Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | net/http/http_network_transaction.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.h
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h
index ed63db0331059a099a5a0d5273505b95f96041ab..66a9dc2370e4aa27917f142935f9cb7248953166 100644
--- a/net/http/http_network_transaction.h
+++ b/net/http/http_network_transaction.h
@@ -55,8 +55,6 @@ class HttpNetworkTransaction : public HttpTransaction {
private:
FRIEND_TEST(HttpNetworkTransactionTest, ResetStateForRestart);
- void BuildRequestHeaders();
- void BuildTunnelRequest();
void DoCallback(int result);
void OnIOComplete(int result);
@@ -119,10 +117,13 @@ class HttpNetworkTransaction : public HttpTransaction {
// is returned.
int HandleIOError(int error);
- // Called when we reached EOF or got an error. If we should resend the
- // request, sets next_state_ and returns true. Otherwise, does nothing and
- // returns false.
- bool ShouldResendRequest();
+ // Called when we reached EOF or got an error. Returns true if we should
+ // resend the request.
+ bool ShouldResendRequest() const;
+
+ // Resets the connection and the request headers for resend. Called when
+ // ShouldResendRequest() is true.
+ void ResetConnectionAndRequestForResend();
// Called when we encounter a network error that could be resolved by trying
// a new proxy configuration. If there is another proxy configuration to try
@@ -155,12 +156,15 @@ class HttpNetworkTransaction : public HttpTransaction {
// Resets the members of the transaction so it can be restarted.
void ResetStateForRestart();
- // Attach any credentials needed for the proxy server or origin server.
- void ApplyAuth();
+ // Returns true if we should try to add a Proxy-Authorization header
+ bool ShouldApplyProxyAuth() const;
+
+ // Returns true if we should try to add an Authorization header.
+ bool ShouldApplyServerAuth() const;
- // Helper used by ApplyAuth(). Adds either the proxy auth header, or the
- // origin server auth header, as specified by |target|
- void AddAuthorizationHeader(HttpAuth::Target target);
+ // Builds either the proxy auth header, or the origin server auth header,
+ // as specified by |target|.
+ std::string BuildAuthorizationHeader(HttpAuth::Target target) const;
// Returns a log message for all the response headers related to the auth
// challenge.
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | net/http/http_network_transaction.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698