OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 private: | 55 private: |
56 const std::string nonce_; | 56 const std::string nonce_; |
57 DISALLOW_COPY_AND_ASSIGN(FixedNonceGenerator); | 57 DISALLOW_COPY_AND_ASSIGN(FixedNonceGenerator); |
58 }; | 58 }; |
59 | 59 |
60 class Factory : public HttpAuthHandlerFactory { | 60 class Factory : public HttpAuthHandlerFactory { |
61 public: | 61 public: |
62 Factory(); | 62 Factory(); |
63 virtual ~Factory(); | 63 virtual ~Factory(); |
64 | 64 |
| 65 // This factory owns the passed in |nonce_generator|. |
| 66 void set_nonce_generator(const NonceGenerator* nonce_generator); |
| 67 |
65 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, | 68 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, |
66 HttpAuth::Target target, | 69 HttpAuth::Target target, |
67 const GURL& origin, | 70 const GURL& origin, |
68 CreateReason reason, | 71 CreateReason reason, |
69 int digest_nonce_count, | 72 int digest_nonce_count, |
70 const BoundNetLog& net_log, | 73 const BoundNetLog& net_log, |
71 scoped_ptr<HttpAuthHandler>* handler); | 74 scoped_ptr<HttpAuthHandler>* handler); |
72 | 75 |
73 // This factory owns the passed in |nonce_generator|. | |
74 void set_nonce_generator(const NonceGenerator* nonce_generator); | |
75 | |
76 private: | 76 private: |
77 scoped_ptr<const NonceGenerator> nonce_generator_; | 77 scoped_ptr<const NonceGenerator> nonce_generator_; |
78 }; | 78 }; |
79 | 79 |
80 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( | 80 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( |
81 HttpAuth::ChallengeTokenizer* challenge); | 81 HttpAuth::ChallengeTokenizer* challenge); |
82 | 82 |
83 protected: | 83 protected: |
84 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); | 84 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); |
85 | 85 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 DigestAlgorithm algorithm_; | 168 DigestAlgorithm algorithm_; |
169 QualityOfProtection qop_; | 169 QualityOfProtection qop_; |
170 | 170 |
171 int nonce_count_; | 171 int nonce_count_; |
172 const NonceGenerator* nonce_generator_; | 172 const NonceGenerator* nonce_generator_; |
173 }; | 173 }; |
174 | 174 |
175 } // namespace net | 175 } // namespace net |
176 | 176 |
177 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 177 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
OLD | NEW |