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

Unified Diff: net/http/http_auth_cache.h

Issue 1157333005: [net/http auth] Use strings to identify authentication schemes. Base URL: https://chromium.googlesource.com/chromium/src.git@master
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.cc ('k') | net/http/http_auth_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_cache.h
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
index f05f8184d023a50fb9ae736a4db8b2d110221097..fe902e325ad45375e79b9982b6f8f209e59d8182 100644
--- a/net/http/http_auth_cache.h
+++ b/net/http/http_auth_cache.h
@@ -38,10 +38,9 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
// The case-sensitive realm string of the challenge.
const std::string& realm() const { return realm_; }
- // The authentication scheme of the challenge.
- HttpAuth::Scheme scheme() const {
- return scheme_;
- }
+ // The normalized authentication scheme of the challenge. See
+ // HttpAuth::IsValidNormalizedScheme().
+ const std::string& scheme() const { return scheme_; }
// The authentication challenge.
const std::string& auth_challenge() const { return auth_challenge_; }
@@ -83,7 +82,7 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
// |origin_| contains the {protocol, host, port} of the server.
GURL origin_;
std::string realm_;
- HttpAuth::Scheme scheme_;
+ std::string scheme_;
// Identity.
std::string auth_challenge_;
@@ -114,11 +113,11 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
// scheme |scheme|.
// |origin| - the {scheme, host, port} of the server.
// |realm| - case sensitive realm string.
- // |scheme| - the authentication scheme (i.e. basic, negotiate).
+ // |scheme| - the normalized authentication scheme (i.e. basic, negotiate).
// returns - the matched entry or NULL.
Entry* Lookup(const GURL& origin,
const std::string& realm,
- HttpAuth::Scheme scheme);
+ const std::string& scheme);
// Find the entry on server |origin| whose protection space includes
// |path|. This uses the assumption in RFC 2617 section 2 that deeper
@@ -135,14 +134,15 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
// paths list.
// |origin| - the {scheme, host, port} of the server.
// |realm| - the auth realm for the challenge.
- // |scheme| - the authentication scheme (i.e. basic, negotiate).
+ // |scheme| - the normalized authentication scheme (i.e. basic,
+ // negotiate).
// |credentials| - login information for the realm.
// |path| - absolute path for a resource contained in the protection
// space; this will be added to the list of known paths.
// returns - the entry that was just added/updated.
Entry* Add(const GURL& origin,
const std::string& realm,
- HttpAuth::Scheme scheme,
+ const std::string& scheme,
const std::string& auth_challenge,
const AuthCredentials& credentials,
const std::string& path);
@@ -151,25 +151,26 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
// if one exists AND if the cached credentials matches |credentials|.
// |origin| - the {scheme, host, port} of the server.
// |realm| - case sensitive realm string.
- // |scheme| - the authentication scheme (i.e. basic, negotiate).
+ // |scheme| - the normalized authentication scheme (i.e. basic,
+ // negotiate).
// |credentials| - the credentials to match.
// returns - true if an entry was removed.
bool Remove(const GURL& origin,
const std::string& realm,
- HttpAuth::Scheme scheme,
+ const std::string& scheme,
const AuthCredentials& credentials);
// Clears the cache.
void Clear();
// Updates a stale digest entry on server |origin| for realm |realm| and
- // scheme |scheme|. The cached auth challenge is replaced with
+ // normalized scheme |scheme|. The cached auth challenge is replaced with
// |auth_challenge| and the nonce count is reset.
// |UpdateStaleChallenge()| returns true if a matching entry exists in the
// cache, false otherwise.
bool UpdateStaleChallenge(const GURL& origin,
const std::string& realm,
- HttpAuth::Scheme scheme,
+ const std::string& scheme,
const std::string& auth_challenge);
// Copies all entries from |other| cache.
« no previous file with comments | « net/http/http_auth.cc ('k') | net/http/http_auth_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698