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

Unified Diff: net/http/http_network_transaction.h

Issue 51004: Respect cookies set in a 401 responses when restarting the http transaction.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address rest of wtc's comments (had missed some in previous patchset) Created 11 years, 9 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 | « net/http/http_cache.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.h
===================================================================
--- net/http/http_network_transaction.h (revision 12402)
+++ net/http/http_network_transaction.h (working copy)
@@ -41,6 +41,11 @@
virtual int RestartWithAuth(const std::wstring& username,
const std::wstring& password,
CompletionCallback* callback);
+ virtual bool IsReadyToRestartForAuth() {
+ return pending_auth_target_ != HttpAuth::AUTH_NONE &&
+ HaveAuth(pending_auth_target_);
+ }
+
virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback);
virtual const HttpResponseInfo* GetResponseInfo() const;
virtual LoadState GetLoadState() const;
@@ -152,10 +157,8 @@
void AddAuthorizationHeader(HttpAuth::Target target);
// Handles HTTP status code 401 or 407.
- // HandleAuthChallenge() returns a network error code, or OK, or
- // WILL_RESTART_TRANSACTION. The latter indicates that the state machine has
- // been updated to restart the transaction with a new auth attempt.
- enum { WILL_RESTART_TRANSACTION = 1 };
+ // HandleAuthChallenge() returns a network error code, or OK on success.
+ // May update |pending_auth_target_| or |response_.auth_challenge|.
int HandleAuthChallenge();
// Populates response_.auth_challenge with the challenge information, so that
@@ -177,10 +180,6 @@
// auth_handler_[target] with the cache entry's data and returns true.
bool SelectPreemptiveAuth(HttpAuth::Target target);
- bool NeedAuth(HttpAuth::Target target) const {
- return auth_handler_[target].get() && auth_identity_[target].invalid;
- }
-
bool HaveAuth(HttpAuth::Target target) const {
return auth_handler_[target].get() && !auth_identity_[target].invalid;
}
@@ -206,6 +205,11 @@
// a number of places (url, cache, prompt).
HttpAuth::Identity auth_identity_[2];
+ // Whether this transaction is waiting for proxy auth, server auth, or is
+ // not waiting for any auth at all. |pending_auth_target_| is read and
+ // cleared by RestartWithAuth().
+ HttpAuth::Target pending_auth_target_;
+
CompletionCallbackImpl<HttpNetworkTransaction> io_callback_;
CompletionCallback* user_callback_;
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698