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

Unified Diff: net/http/http_auth_cache.h

Issue 6191001: Cleanup: Use AUTH_SCHEME enum instead of a string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Added AUTH_SCHEME_MOCK Created 9 years, 11 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
Index: net/http/http_auth_cache.h
===================================================================
--- net/http/http_auth_cache.h (revision 70507)
+++ net/http/http_auth_cache.h (working copy)
@@ -13,6 +13,7 @@
#include "base/ref_counted.h"
#include "base/string16.h"
#include "googleurl/src/gurl.h"
+#include "net/http/http_auth.h"
namespace net {
@@ -35,10 +36,11 @@
// scheme |scheme|.
// |origin| - the {scheme, host, port} of the server.
// |realm| - case sensitive realm string.
- // |scheme| - case sensitive authentication scheme, should be lower-case.
+ // |scheme| - the authentication scheme (i.e. basic, negotiate).
// returns - the matched entry or NULL.
- Entry* Lookup(const GURL& origin, const std::string& realm,
- const std::string& scheme);
+ Entry* Lookup(const GURL& origin,
+ const std::string& realm,
+ HttpAuth::Scheme scheme);
// Find the entry on server |origin| whose protection space includes
// |path|. This uses the assumption in RFC 2617 section 2 that deeper
@@ -55,7 +57,7 @@
// paths list.
// |origin| - the {scheme, host, port} of the server.
// |realm| - the auth realm for the challenge.
- // |scheme| - the authentication scheme for the challenge.
+ // |scheme| - the authentication scheme (i.e. basic, negotiate).
// |username| - login information for the realm.
// |password| - login information for the realm.
// |path| - absolute path for a resource contained in the protection
@@ -63,7 +65,7 @@
// returns - the entry that was just added/updated.
Entry* Add(const GURL& origin,
const std::string& realm,
- const std::string& scheme,
+ HttpAuth::Scheme scheme,
const std::string& auth_challenge,
const string16& username,
const string16& password,
@@ -73,13 +75,13 @@
// if one exists AND if the cached identity matches (|username|, |password|).
// |origin| - the {scheme, host, port} of the server.
// |realm| - case sensitive realm string.
- // |scheme| - authentication scheme
+ // |scheme| - the authentication scheme (i.e. basic, negotiate).
// |username| - condition to match.
// |password| - condition to match.
// returns - true if an entry was removed.
bool Remove(const GURL& origin,
const std::string& realm,
- const std::string& scheme,
+ HttpAuth::Scheme scheme,
const string16& username,
const string16& password);
@@ -90,7 +92,7 @@
// cache, false otherwise.
bool UpdateStaleChallenge(const GURL& origin,
const std::string& realm,
- const std::string& scheme,
+ HttpAuth::Scheme scheme,
const std::string& auth_challenge);
// Prevent unbounded memory growth. These are safeguards for abuse; it is
@@ -118,7 +120,7 @@
}
// The authentication scheme string of the challenge
eroman 2011/01/10 19:32:39 "string" -- no longer applicable.
cbentzel 2011/01/11 16:54:18 Done.
- const std::string scheme() const {
+ const HttpAuth::Scheme scheme() const {
return scheme_;
}
@@ -159,10 +161,10 @@
// Returns true if |dir| is contained within the realm's protection space.
bool HasEnclosingPath(const std::string& dir);
- // |origin_| contains the {scheme, host, port} of the server.
+ // |origin_| contains the {protocol, host, port} of the server.
GURL origin_;
std::string realm_;
- std::string scheme_;
+ HttpAuth::Scheme scheme_;
// Identity.
std::string auth_challenge_;

Powered by Google App Engine
This is Rietveld 408576698