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 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 std::string* auth_token); | 101 std::string* auth_token); |
102 | 102 |
103 virtual int GenerateDefaultAuthToken(const HttpRequestInfo* request, | 103 virtual int GenerateDefaultAuthToken(const HttpRequestInfo* request, |
104 const ProxyInfo* proxy, | 104 const ProxyInfo* proxy, |
105 std::string* auth_token); | 105 std::string* auth_token); |
106 | 106 |
107 virtual int ResolveCanonicalName(HostResolver* host_resolver, | 107 virtual int ResolveCanonicalName(HostResolver* host_resolver, |
108 CompletionCallback* callback, | 108 CompletionCallback* callback, |
109 const BoundNetLog& net_log); | 109 const BoundNetLog& net_log); |
110 | 110 |
| 111 #if defined(OS_WIN) |
| 112 // These are public for unit tests |
| 113 std::wstring CreateSPN(const AddressList& address_list, const GURL& orign); |
| 114 const std::wstring& spn() const { return spn_; } |
| 115 #endif // defined(OS_WIN) |
| 116 |
111 protected: | 117 protected: |
112 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); | 118 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); |
113 | 119 |
114 private: | 120 private: |
115 ~HttpAuthHandlerNegotiate(); | 121 ~HttpAuthHandlerNegotiate(); |
116 | 122 |
117 #if defined(OS_WIN) | 123 #if defined(OS_WIN) |
118 void OnResolveCanonicalName(int result); | 124 void OnResolveCanonicalName(int result); |
119 std::wstring CreateSPN(const AddressList& address_list, const GURL& orign); | |
120 | |
121 HttpAuthSSPI auth_sspi_; | 125 HttpAuthSSPI auth_sspi_; |
122 AddressList address_list_; | 126 AddressList address_list_; |
123 scoped_ptr<SingleRequestHostResolver> single_resolve_; | 127 scoped_ptr<SingleRequestHostResolver> single_resolve_; |
124 CompletionCallback* user_callback_; | 128 CompletionCallback* user_callback_; |
125 CompletionCallbackImpl<HttpAuthHandlerNegotiate> resolve_cname_callback_; | 129 CompletionCallbackImpl<HttpAuthHandlerNegotiate> resolve_cname_callback_; |
126 bool disable_cname_lookup_; | 130 bool disable_cname_lookup_; |
127 bool use_port_; | 131 bool use_port_; |
128 std::wstring spn_; | 132 std::wstring spn_; |
129 #endif | 133 #endif |
130 | 134 |
131 const URLSecurityManager* url_security_manager_; | 135 const URLSecurityManager* url_security_manager_; |
132 }; | 136 }; |
133 | 137 |
134 } // namespace net | 138 } // namespace net |
135 | 139 |
136 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 140 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
OLD | NEW |