| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerFactory); | 124 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerFactory); |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 // The HttpAuthHandlerRegistryFactory dispatches create requests out | 127 // The HttpAuthHandlerRegistryFactory dispatches create requests out |
| 128 // to other factories based on the auth scheme. | 128 // to other factories based on the auth scheme. |
| 129 class NET_EXPORT HttpAuthHandlerRegistryFactory | 129 class NET_EXPORT HttpAuthHandlerRegistryFactory |
| 130 : public HttpAuthHandlerFactory { | 130 : public HttpAuthHandlerFactory { |
| 131 public: | 131 public: |
| 132 HttpAuthHandlerRegistryFactory(); | 132 HttpAuthHandlerRegistryFactory(); |
| 133 virtual ~HttpAuthHandlerRegistryFactory(); | 133 ~HttpAuthHandlerRegistryFactory() override; |
| 134 | 134 |
| 135 // Sets an URL security manager into the factory associated with |scheme|. | 135 // Sets an URL security manager into the factory associated with |scheme|. |
| 136 void SetURLSecurityManager(const std::string& scheme, | 136 void SetURLSecurityManager(const std::string& scheme, |
| 137 URLSecurityManager* url_security_manager); | 137 URLSecurityManager* url_security_manager); |
| 138 | 138 |
| 139 // Registers a |factory| that will be used for a particular HTTP | 139 // Registers a |factory| that will be used for a particular HTTP |
| 140 // authentication scheme such as Basic, Digest, or Negotiate. | 140 // authentication scheme such as Basic, Digest, or Negotiate. |
| 141 // The |*factory| object is assumed to be new-allocated, and its lifetime | 141 // The |*factory| object is assumed to be new-allocated, and its lifetime |
| 142 // will be managed by this HttpAuthHandlerRegistryFactory object (including | 142 // will be managed by this HttpAuthHandlerRegistryFactory object (including |
| 143 // deleting it when it is no longer used. | 143 // deleting it when it is no longer used. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 static HttpAuthHandlerRegistryFactory* Create( | 176 static HttpAuthHandlerRegistryFactory* Create( |
| 177 const std::vector<std::string>& supported_schemes, | 177 const std::vector<std::string>& supported_schemes, |
| 178 URLSecurityManager* security_manager, | 178 URLSecurityManager* security_manager, |
| 179 HostResolver* host_resolver, | 179 HostResolver* host_resolver, |
| 180 const std::string& gssapi_library_name, | 180 const std::string& gssapi_library_name, |
| 181 bool negotiate_disable_cname_lookup, | 181 bool negotiate_disable_cname_lookup, |
| 182 bool negotiate_enable_port); | 182 bool negotiate_enable_port); |
| 183 | 183 |
| 184 // Creates an auth handler by dispatching out to the registered factories | 184 // Creates an auth handler by dispatching out to the registered factories |
| 185 // based on the first token in |challenge|. | 185 // based on the first token in |challenge|. |
| 186 virtual int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 186 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
| 187 HttpAuth::Target target, | 187 HttpAuth::Target target, |
| 188 const GURL& origin, | 188 const GURL& origin, |
| 189 CreateReason reason, | 189 CreateReason reason, |
| 190 int digest_nonce_count, | 190 int digest_nonce_count, |
| 191 const BoundNetLog& net_log, | 191 const BoundNetLog& net_log, |
| 192 scoped_ptr<HttpAuthHandler>* handler) override; | 192 scoped_ptr<HttpAuthHandler>* handler) override; |
| 193 | 193 |
| 194 private: | 194 private: |
| 195 typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap; | 195 typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap; |
| 196 | 196 |
| 197 FactoryMap factory_map_; | 197 FactoryMap factory_map_; |
| 198 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); | 198 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 } // namespace net | 201 } // namespace net |
| 202 | 202 |
| 203 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ | 203 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
| OLD | NEW |