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_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/time.h" | |
13 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
14 #include "net/base/net_log.h" | 13 #include "net/base/net_log.h" |
15 #include "net/http/http_auth.h" | 14 #include "net/http/http_auth.h" |
16 | 15 |
17 namespace base { | |
18 class Histogram; | |
19 } | |
20 | |
21 namespace net { | 16 namespace net { |
22 | 17 |
23 struct HttpRequestInfo; | 18 struct HttpRequestInfo; |
24 | 19 |
25 // HttpAuthHandler is the interface for the authentication schemes | 20 // HttpAuthHandler is the interface for the authentication schemes |
26 // (basic, digest, NTLM, Negotiate). | 21 // (basic, digest, NTLM, Negotiate). |
27 // HttpAuthHandler objects are typically created by an HttpAuthHandlerFactory. | 22 // HttpAuthHandler objects are typically created by an HttpAuthHandlerFactory. |
28 class HttpAuthHandler { | 23 class HttpAuthHandler { |
29 public: | 24 public: |
30 enum AuthScheme { | 25 enum AuthScheme { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 HttpAuth::Target target_; | 194 HttpAuth::Target target_; |
200 | 195 |
201 // A bitmask of the properties of the authentication scheme. | 196 // A bitmask of the properties of the authentication scheme. |
202 int properties_; | 197 int properties_; |
203 | 198 |
204 BoundNetLog net_log_; | 199 BoundNetLog net_log_; |
205 | 200 |
206 private: | 201 private: |
207 void OnGenerateAuthTokenComplete(int rv); | 202 void OnGenerateAuthTokenComplete(int rv); |
208 void FinishGenerateAuthToken(); | 203 void FinishGenerateAuthToken(); |
209 static std::string GenerateHistogramNameFromScheme(const std::string& scheme); | |
210 | 204 |
211 CompletionCallback* original_callback_; | 205 CompletionCallback* original_callback_; |
212 CompletionCallbackImpl<HttpAuthHandler> wrapper_callback_; | 206 CompletionCallbackImpl<HttpAuthHandler> wrapper_callback_; |
213 // When GenerateAuthToken was called. | |
214 base::TimeTicks generate_auth_token_start_; | |
215 scoped_refptr<base::Histogram> histogram_; | |
216 }; | 207 }; |
217 | 208 |
218 } // namespace net | 209 } // namespace net |
219 | 210 |
220 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_ | 211 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_ |
OLD | NEW |