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

Unified Diff: net/http/http_auth_handler.h

Issue 1383613002: [net/http auth] Cleanup. Method names, and constness. Base URL: https://chromium.googlesource.com/chromium/src.git@mock-auth-handler-generalization
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_unittest.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 bf01bc371bc6b0e8b1322e215d7e9c8c4ff63038..5aa39c5b01e06bf51566dae7973f03713c946bb2 100644
--- a/net/http/http_auth_handler.h
+++ b/net/http/http_auth_handler.h
@@ -30,10 +30,10 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
// authentication scheme, but none of the tokens occurring after the
// authentication scheme. |target| and |origin| are both stored
// for later use, and are not part of the initial challenge.
- bool InitFromChallenge(HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- const BoundNetLog& net_log);
+ int HandleInitialChallenge(const HttpAuthChallengeTokenizer& challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ const BoundNetLog& net_log);
// Determines how the previous authorization attempt was received.
//
@@ -49,7 +49,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
// authentication scheme, but none of the tokens occurring after the
// authentication scheme.
virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
- HttpAuthChallengeTokenizer* challenge) = 0;
+ const HttpAuthChallengeTokenizer& challenge) = 0;
// Generates an authentication token, potentially asynchronously.
//
@@ -72,7 +72,7 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
// All other return codes indicate that there was a problem generating a
// token, and the value of |*auth_token| is unspecified.
int GenerateAuthToken(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
+ const HttpRequestInfo& request,
const CompletionCallback& callback,
std::string* auth_token);
@@ -105,9 +105,9 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
virtual bool NeedsIdentity();
// Returns whether the default credentials may be used for the |origin| passed
- // into |InitFromChallenge|. If true, the user does not need to be prompted
- // for username and password to establish credentials.
- // NOTE: SSO is a potential security risk.
+ // into |HandleInitialChallenge|. If true, the user does not need to be
+ // prompted for username and password to establish credentials. NOTE: SSO is
+ // a potential security risk.
// TODO(cbentzel): Add a pointer to Firefox documentation about risk.
virtual bool AllowsDefaultCredentials();
@@ -117,19 +117,18 @@ class NET_EXPORT_PRIVATE HttpAuthHandler {
virtual bool AllowsExplicitCredentials();
protected:
- // Initializes the handler using a challenge issued by a server.
- // |challenge| must be non-NULL and have already tokenized the
- // authentication scheme, but none of the tokens occurring after the
- // authentication scheme.
- // Implementations are expected to initialize the following members:
- // scheme_, realm_
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) = 0;
+ // Initializes the handler using a challenge issued by a server. |challenge|
+ // must be non-NULL and have already tokenized the authentication scheme, but
+ // 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;
// |GenerateAuthTokenImpl()} is the auth-scheme specific implementation
// of generating the next auth token. Callers should use |GenerateAuthToken()|
// which will in turn call |GenerateAuthTokenImpl()|
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
+ const HttpRequestInfo& request,
const CompletionCallback& callback,
std::string* auth_token) = 0;
« no previous file with comments | « net/http/http_auth_gssapi_posix_unittest.cc ('k') | net/http/http_auth_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698