Chromium Code Reviews| Index: net/http/http_auth.h |
| =================================================================== |
| --- net/http/http_auth.h (revision 70507) |
| +++ net/http/http_auth.h (working copy) |
| @@ -80,6 +80,15 @@ |
| IDENT_SRC_DEFAULT_CREDENTIALS, |
| }; |
| + enum Scheme { |
| + AUTH_SCHEME_BASIC = 0, |
| + AUTH_SCHEME_DIGEST, |
| + AUTH_SCHEME_NTLM, |
| + AUTH_SCHEME_NEGOTIATE, |
| + AUTH_SCHEME_MOCK, |
| + AUTH_SCHEME_MAX, |
| + }; |
| + |
| // Helper structure used by HttpNetworkTransaction to track |
| // the current identity being used for authorization. |
| struct Identity { |
| @@ -91,6 +100,8 @@ |
| string16 password; |
| }; |
| + // TODO(cbentzel): Change these to return const char* instead. |
|
eroman
2011/01/10 19:32:39
What function(s) is this comment referring to?
cbentzel
2011/01/11 16:54:18
For the GetChallengeHaeaderName/GetAuthorizationHe
|
| + |
| // Get the name of the header containing the auth challenge |
| // (either WWW-Authenticate or Proxy-Authenticate). |
| static std::string GetChallengeHeaderName(Target target); |
| @@ -103,6 +114,9 @@ |
| // messages. |
| static std::string GetAuthTargetString(Target target); |
| + // Returns a string representation of an authentication Scheme. |
| + static std::string GetSchemeName(Scheme scheme); |
|
eroman
2011/01/10 19:32:39
nit: I suggest calling this:
const char* SchemeT
cbentzel
2011/01/11 16:54:18
Done.
|
| + |
| // Iterate through the challenge headers, and pick the best one that |
| // we support. Obtains the implementation class for handling the challenge, |
| // and passes it back in |*handler|. If no supported challenge was found, |
| @@ -117,7 +131,7 @@ |
| const HttpResponseHeaders* headers, |
| Target target, |
| const GURL& origin, |
| - const std::set<std::string>& disabled_schemes, |
| + const std::set<Scheme>& disabled_schemes, |
| const BoundNetLog& net_log, |
| scoped_ptr<HttpAuthHandler>* handler); |
| @@ -146,7 +160,7 @@ |
| HttpAuthHandler* handler, |
| const HttpResponseHeaders* headers, |
| Target target, |
| - const std::set<std::string>& disabled_schemes, |
| + const std::set<Scheme>& disabled_schemes, |
| std::string* challenge_used); |
| // Breaks up a challenge string into the the auth scheme and parameter list, |