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_CONTROLLER_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
6 #define NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 6 #define NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
17 #include "net/http/http_auth.h" | 17 #include "net/http/http_auth.h" |
| 18 #include "net/http/http_auth_scheme_set.h" |
18 #include "net/log/net_log.h" | 19 #include "net/log/net_log.h" |
19 #include "url/gurl.h" | 20 #include "url/gurl.h" |
20 | 21 |
21 namespace net { | 22 namespace net { |
22 | 23 |
23 class AuthChallengeInfo; | 24 class AuthChallengeInfo; |
24 class AuthCredentials; | 25 class AuthCredentials; |
25 class HttpAuthHandler; | 26 class HttpAuthHandler; |
26 class HttpAuthHandlerFactory; | 27 class HttpAuthHandlerFactory; |
27 class HttpAuthCache; | 28 class HttpAuthCache; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 63 |
63 // Store the supplied credentials and prepare to restart the auth. | 64 // Store the supplied credentials and prepare to restart the auth. |
64 virtual void ResetAuth(const AuthCredentials& credentials); | 65 virtual void ResetAuth(const AuthCredentials& credentials); |
65 | 66 |
66 virtual bool HaveAuthHandler() const; | 67 virtual bool HaveAuthHandler() const; |
67 | 68 |
68 virtual bool HaveAuth() const; | 69 virtual bool HaveAuth() const; |
69 | 70 |
70 virtual scoped_refptr<AuthChallengeInfo> auth_info(); | 71 virtual scoped_refptr<AuthChallengeInfo> auth_info(); |
71 | 72 |
72 virtual bool IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const; | 73 virtual bool IsAuthSchemeDisabled(const std::string& scheme) const; |
73 virtual void DisableAuthScheme(HttpAuth::Scheme scheme); | 74 virtual void DisableAuthScheme(const std::string& scheme); |
74 virtual void DisableEmbeddedIdentity(); | 75 virtual void DisableEmbeddedIdentity(); |
75 | 76 |
76 private: | 77 private: |
77 // Actions for InvalidateCurrentHandler() | 78 // Actions for InvalidateCurrentHandler() |
78 enum InvalidateHandlerAction { | 79 enum InvalidateHandlerAction { |
79 INVALIDATE_HANDLER_AND_CACHED_CREDENTIALS, | 80 INVALIDATE_HANDLER_AND_CACHED_CREDENTIALS, |
80 INVALIDATE_HANDLER_AND_DISABLE_SCHEME, | 81 INVALIDATE_HANDLER_AND_DISABLE_SCHEME, |
81 INVALIDATE_HANDLER | 82 INVALIDATE_HANDLER |
82 }; | 83 }; |
83 | 84 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // True if default credentials have already been tried for this transaction | 155 // True if default credentials have already been tried for this transaction |
155 // in response to an HTTP authentication challenge. | 156 // in response to an HTTP authentication challenge. |
156 bool default_credentials_used_; | 157 bool default_credentials_used_; |
157 | 158 |
158 // These two are owned by the HttpNetworkSession/IOThread, which own the | 159 // These two are owned by the HttpNetworkSession/IOThread, which own the |
159 // objects which reference |this|. Therefore, these raw pointers are valid | 160 // objects which reference |this|. Therefore, these raw pointers are valid |
160 // for the lifetime of this object. | 161 // for the lifetime of this object. |
161 HttpAuthCache* const http_auth_cache_; | 162 HttpAuthCache* const http_auth_cache_; |
162 HttpAuthHandlerFactory* const http_auth_handler_factory_; | 163 HttpAuthHandlerFactory* const http_auth_handler_factory_; |
163 | 164 |
164 std::set<HttpAuth::Scheme> disabled_schemes_; | 165 HttpAuthSchemeSet disabled_schemes_; |
165 | 166 |
166 CompletionCallback callback_; | 167 CompletionCallback callback_; |
167 }; | 168 }; |
168 | 169 |
169 } // namespace net | 170 } // namespace net |
170 | 171 |
171 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 172 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
OLD | NEW |