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

Unified Diff: net/http/http_auth_handler.h

Issue 1391053002: [net/http auth] Make HttpAuthHandler challenge handling asynchronous. Base URL: https://chromium.googlesource.com/chromium/src.git@auth-handler-init-split
Patch Set: Created 5 years, 2 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_auth_gssapi_posix.cc ('k') | net/http/http_auth_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler.h
diff --git a/net/http/http_auth_handler.h b/net/http/http_auth_handler.h
index 3f2341b01c21124dd01cfc8287b70c68e1140827..5a9d8ee061296eac14aadeecb0b11a5216cdd0d7 100644
--- a/net/http/http_auth_handler.h
+++ b/net/http/http_auth_handler.h
@@ -10,12 +10,14 @@
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
#include "net/http/http_auth.h"
+#include "net/http/http_auth_cache.h"
#include "net/log/net_log.h"
namespace net {
class HttpAuthChallengeTokenizer;
struct HttpRequestInfo;
+class HttpResponseInfo;
// HttpAuthHandler is the interface for the authentication schemes
// (basic, digest, NTLM, Negotiate). Each authentication scheme is expected to
@@ -59,6 +61,10 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
public:
virtual ~HttpAuthHandler();
+ int InitializeFromCacheEntry(HttpAuthCache::Entry* cache_entry,
+ HttpAuth::Target target,
+ const BoundNetLog& net_log);
+
// Initializes the handler and associates it with the specified |target| and
// |origin|. The |net_log| parameter indicates BoundNetLog to be used for the
// lifetime of this handler. |challenge| is required and *must* match the
@@ -70,9 +76,11 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
// Note: This method *must* be the first method to be invoked on the
// HttpAuthHandler.
int HandleInitialChallenge(const HttpAuthChallengeTokenizer& challenge,
+ const HttpResponseInfo& response_info,
HttpAuth::Target target,
const GURL& origin,
- const BoundNetLog& net_log);
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback);
// Generates an authentication token, potentially asynchronously.
//
@@ -180,7 +188,16 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
// none of the tokens occurring after the authentication scheme.
// Implementations are expected to initialize the following members: scheme_,
// realm_
- virtual int Init(const HttpAuthChallengeTokenizer& challenge) = 0;
+ //
+ // TODO(asanka): Update comment.
+ virtual int InitializeFromChallengeInternal(
+ const HttpAuthChallengeTokenizer& challenge,
+ const HttpResponseInfo& response_with_challenge,
+ const CompletionCallback& callback) = 0;
+
+ // TODO(asanka): Update comment
+ virtual int InitializeFromCacheEntryInternal(
+ HttpAuthCache::Entry* cache_entry) = 0;
// |GenerateAuthTokenImpl()} is the auth-scheme specific implementation
// of generating the next auth token. Callers should use |GenerateAuthToken()|
« no previous file with comments | « net/http/http_auth_gssapi_posix.cc ('k') | net/http/http_auth_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698