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_FACTORY_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const std::string& scheme) = 0; | 75 const std::string& scheme) = 0; |
76 | 76 |
77 // Creates an HTTP authentication handler based on the authentication | 77 // Creates an HTTP authentication handler based on the authentication |
78 // challenge string |challenge|. | 78 // challenge string |challenge|. |
79 // This is a convenience function which creates a ChallengeTokenizer for | 79 // This is a convenience function which creates a ChallengeTokenizer for |
80 // |challenge| and calls |CreateAuthHandler|. See |CreateAuthHandler| for | 80 // |challenge| and calls |CreateAuthHandler|. See |CreateAuthHandler| for |
81 // more details on return values. | 81 // more details on return values. |
82 // TODO(asanka): UPdate comment | 82 // TODO(asanka): UPdate comment |
83 virtual scoped_ptr<HttpAuthHandler> CreateAndInitPreemptiveAuthHandler( | 83 virtual scoped_ptr<HttpAuthHandler> CreateAndInitPreemptiveAuthHandler( |
84 HttpAuthCache::Entry* cache_entry, | 84 HttpAuthCache::Entry* cache_entry, |
85 const HttpAuthChallengeTokenizer& tokenizer, | |
86 HttpAuth::Target target, | 85 HttpAuth::Target target, |
87 const BoundNetLog& net_log) = 0; | 86 const BoundNetLog& net_log) = 0; |
88 | 87 |
89 // Creates a standard HttpAuthHandlerRegistryFactory. The caller is | 88 // Creates a standard HttpAuthHandlerRegistryFactory. The caller is |
90 // responsible for deleting the factory. | 89 // responsible for deleting the factory. |
91 // The default factory supports Basic, Digest, NTLM, and Negotiate schemes. | 90 // The default factory supports Basic, Digest, NTLM, and Negotiate schemes. |
92 // | 91 // |
93 // |resolver| is used by the Negotiate authentication handler to perform | 92 // |resolver| is used by the Negotiate authentication handler to perform |
94 // CNAME lookups to generate a Kerberos SPN for the server. It must be | 93 // CNAME lookups to generate a Kerberos SPN for the server. It must be |
95 // non-NULL. |resolver| must remain valid for the lifetime of the | 94 // non-NULL. |resolver| must remain valid for the lifetime of the |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 bool negotiate_enable_port); | 169 bool negotiate_enable_port); |
171 | 170 |
172 scoped_ptr<HttpAuthHandler> CreateAuthHandlerForScheme( | 171 scoped_ptr<HttpAuthHandler> CreateAuthHandlerForScheme( |
173 const std::string& scheme) override; | 172 const std::string& scheme) override; |
174 | 173 |
175 // Create an auth handler by dispatching the CreateAuthHandler() call to the | 174 // Create an auth handler by dispatching the CreateAuthHandler() call to the |
176 // factory registered to handle challenge->scheme(). TODO(asanka): Update | 175 // factory registered to handle challenge->scheme(). TODO(asanka): Update |
177 // comment | 176 // comment |
178 scoped_ptr<HttpAuthHandler> CreateAndInitPreemptiveAuthHandler( | 177 scoped_ptr<HttpAuthHandler> CreateAndInitPreemptiveAuthHandler( |
179 HttpAuthCache::Entry* cache_entry, | 178 HttpAuthCache::Entry* cache_entry, |
180 const HttpAuthChallengeTokenizer& tokenizer, | |
181 HttpAuth::Target target, | 179 HttpAuth::Target target, |
182 const BoundNetLog& net_log) override; | 180 const BoundNetLog& net_log) override; |
183 | 181 |
184 private: | 182 private: |
185 typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap; | 183 typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap; |
186 | 184 |
187 FactoryMap factory_map_; | 185 FactoryMap factory_map_; |
188 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); | 186 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); |
189 }; | 187 }; |
190 | 188 |
191 } // namespace net | 189 } // namespace net |
192 | 190 |
193 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ | 191 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
OLD | NEW |