OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 ~Factory() override; | 63 ~Factory() override; |
64 | 64 |
65 // This factory owns the passed in |nonce_generator|. | 65 // This factory owns the passed in |nonce_generator|. |
66 void set_nonce_generator(const NonceGenerator* nonce_generator); | 66 void set_nonce_generator(const NonceGenerator* nonce_generator); |
67 | 67 |
68 // HttpAuthHandlerFactory | 68 // HttpAuthHandlerFactory |
69 scoped_ptr<HttpAuthHandler> CreateAuthHandlerForScheme( | 69 scoped_ptr<HttpAuthHandler> CreateAuthHandlerForScheme( |
70 const std::string& scheme) override; | 70 const std::string& scheme) override; |
71 scoped_ptr<HttpAuthHandler> CreateAndInitPreemptiveAuthHandler( | 71 scoped_ptr<HttpAuthHandler> CreateAndInitPreemptiveAuthHandler( |
72 HttpAuthCache::Entry* cache_entry, | 72 HttpAuthCache::Entry* cache_entry, |
73 const HttpAuthChallengeTokenizer& tokenizer, | |
74 HttpAuth::Target target, | 73 HttpAuth::Target target, |
75 const BoundNetLog& net_log) override; | 74 const BoundNetLog& net_log) override; |
76 | 75 |
77 private: | 76 private: |
78 scoped_ptr<const NonceGenerator> nonce_generator_; | 77 scoped_ptr<const NonceGenerator> nonce_generator_; |
79 }; | 78 }; |
80 | 79 |
| 80 // HttpAuthHandler |
81 HttpAuth::AuthorizationResult HandleAnotherChallenge( | 81 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
82 const HttpAuthChallengeTokenizer& challenge) override; | 82 const HttpAuthChallengeTokenizer& challenge) override; |
83 ~HttpAuthHandlerDigest() override; | 83 ~HttpAuthHandlerDigest() override; |
84 | 84 |
85 protected: | 85 protected: |
86 int Init(const HttpAuthChallengeTokenizer& challenge) override; | 86 // HttpAuthHandler |
87 | 87 int InitializeFromChallengeInternal( |
| 88 const HttpAuthChallengeTokenizer& challenge, |
| 89 const HttpResponseInfo& response_with_challenge, |
| 90 const CompletionCallback& callback) override; |
| 91 int InitializeFromCacheEntryInternal( |
| 92 HttpAuthCache::Entry* cache_entry) override; |
88 int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 93 int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
89 const HttpRequestInfo& request, | 94 const HttpRequestInfo& request, |
90 const CompletionCallback& callback, | 95 const CompletionCallback& callback, |
91 std::string* auth_token) override; | 96 std::string* auth_token) override; |
92 | 97 |
93 private: | 98 private: |
94 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, ParseChallenge); | 99 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, ParseChallenge); |
95 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, AssembleCredentials); | 100 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, AssembleCredentials); |
96 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, DigestPreAuthNonceCount); | 101 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, DigestPreAuthNonceCount); |
97 | 102 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // UTF-8. | 176 // UTF-8. |
172 std::string original_realm_; | 177 std::string original_realm_; |
173 | 178 |
174 int nonce_count_; | 179 int nonce_count_; |
175 const NonceGenerator* nonce_generator_; | 180 const NonceGenerator* nonce_generator_; |
176 }; | 181 }; |
177 | 182 |
178 } // namespace net | 183 } // namespace net |
179 | 184 |
180 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 185 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
OLD | NEW |