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_NEGOTIATE_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 void set_host_resolver(HostResolver* host_resolver); | 65 void set_host_resolver(HostResolver* host_resolver); |
66 | 66 |
67 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, | 67 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, |
68 HttpAuth::Target target, | 68 HttpAuth::Target target, |
69 const GURL& origin, | 69 const GURL& origin, |
70 CreateReason reason, | 70 CreateReason reason, |
71 int digest_nonce_count, | 71 int digest_nonce_count, |
72 const BoundNetLog& net_log, | 72 const BoundNetLog& net_log, |
73 scoped_ptr<HttpAuthHandler>* handler); | 73 scoped_ptr<HttpAuthHandler>* handler); |
74 | 74 |
75 // Set the system library to use. Typically the only callers which need to | 75 // Set the system library to use. |
76 // use this are unit tests which pass in a mocked-out version of the | 76 // Callers beware: the passed |*auth_library| will be deleted when this |
77 // system library. | 77 // factory is destructed. |
danno
2010/11/10 16:52:01
Instead of "callers beware:..." you will often fin
Jakob Kummerow (corp)
2010/11/10 17:48:39
Done.
| |
78 // The caller is responsible for managing the lifetime of |*auth_library|, | |
79 // and the lifetime must exceed that of this Factory object and all | |
80 // HttpAuthHandler's that this Factory object creates. | |
81 void set_library(AuthLibrary* auth_library) { | 78 void set_library(AuthLibrary* auth_library) { |
82 auth_library_ = auth_library; | 79 auth_library_.reset(auth_library); |
83 } | 80 } |
84 | 81 |
85 private: | 82 private: |
86 bool disable_cname_lookup_; | 83 bool disable_cname_lookup_; |
87 bool use_port_; | 84 bool use_port_; |
88 HostResolver* resolver_; | 85 HostResolver* resolver_; |
89 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
90 ULONG max_token_length_; | 87 ULONG max_token_length_; |
91 bool first_creation_; | 88 bool first_creation_; |
92 bool is_unsupported_; | 89 bool is_unsupported_; |
93 #endif | 90 #endif |
94 AuthLibrary* auth_library_; | 91 scoped_ptr<AuthLibrary> auth_library_; |
95 }; | 92 }; |
96 | 93 |
97 HttpAuthHandlerNegotiate(AuthLibrary* sspi_library, | 94 HttpAuthHandlerNegotiate(AuthLibrary* sspi_library, |
98 #if defined(OS_WIN) | 95 #if defined(OS_WIN) |
99 ULONG max_token_length, | 96 ULONG max_token_length, |
100 #endif | 97 #endif |
101 URLSecurityManager* url_security_manager, | 98 URLSecurityManager* url_security_manager, |
102 HostResolver* host_resolver, | 99 HostResolver* host_resolver, |
103 bool disable_cname_lookup, | 100 bool disable_cname_lookup, |
104 bool use_port); | 101 bool use_port); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 std::string* auth_token_; | 163 std::string* auth_token_; |
167 | 164 |
168 State next_state_; | 165 State next_state_; |
169 | 166 |
170 const URLSecurityManager* url_security_manager_; | 167 const URLSecurityManager* url_security_manager_; |
171 }; | 168 }; |
172 | 169 |
173 } // namespace net | 170 } // namespace net |
174 | 171 |
175 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 172 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
OLD | NEW |