Chromium Code Reviews| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 virtual bool HaveAuthHandler() const; | 66 virtual bool HaveAuthHandler() const; |
| 67 | 67 |
| 68 virtual bool HaveAuth() const; | 68 virtual bool HaveAuth() const; |
| 69 | 69 |
| 70 virtual scoped_refptr<AuthChallengeInfo> auth_info(); | 70 virtual scoped_refptr<AuthChallengeInfo> auth_info(); |
| 71 | 71 |
| 72 virtual bool IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const; | 72 virtual bool IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const; |
| 73 virtual void DisableAuthScheme(HttpAuth::Scheme scheme); | 73 virtual void DisableAuthScheme(HttpAuth::Scheme scheme); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 // Actions for InvalidateCurrentHandler() | |
| 77 enum InvalidateHandlerAction { | |
| 78 INVALIDATE_HANDLER_AND_CACHED_CREDENTIALS, | |
| 79 INVALIDATE_HANDLER | |
| 80 }; | |
| 81 | |
| 76 // So that we can mock this object. | 82 // So that we can mock this object. |
| 77 friend class base::RefCounted<HttpAuthController>; | 83 friend class base::RefCounted<HttpAuthController>; |
| 78 | 84 |
| 79 virtual ~HttpAuthController(); | 85 virtual ~HttpAuthController(); |
| 80 | 86 |
| 81 // Searches the auth cache for an entry that encompasses the request's path. | 87 // Searches the auth cache for an entry that encompasses the request's path. |
| 82 // If such an entry is found, updates |identity_| and |handler_| with the | 88 // If such an entry is found, updates |identity_| and |handler_| with the |
| 83 // cache entry's data and returns true. | 89 // cache entry's data and returns true. |
| 84 bool SelectPreemptiveAuth(const BoundNetLog& net_log); | 90 bool SelectPreemptiveAuth(const BoundNetLog& net_log); |
| 85 | 91 |
| 86 // Invalidates the current handler, including cache. | 92 // Invalidates the current handler, including cache. |
|
wtc
2011/02/22 23:17:32
IMPORTANT: please update the comment. "including
asanka
2011/02/23 18:06:40
I'll fix this in another CL, since I already lande
| |
| 87 void InvalidateCurrentHandler(); | 93 void InvalidateCurrentHandler(InvalidateHandlerAction action); |
| 88 | 94 |
| 89 // Invalidates any auth cache entries after authentication has failed. | 95 // Invalidates any auth cache entries after authentication has failed. |
| 90 // The identity that was rejected is |identity_|. | 96 // The identity that was rejected is |identity_|. |
| 91 void InvalidateRejectedAuthFromCache(); | 97 void InvalidateRejectedAuthFromCache(); |
| 92 | 98 |
| 93 // Sets |identity_| to the next identity that the transaction should try. It | 99 // Sets |identity_| to the next identity that the transaction should try. It |
| 94 // chooses candidates by searching the auth cache and the URL for a | 100 // chooses candidates by searching the auth cache and the URL for a |
| 95 // username:password. Returns true if an identity was found. | 101 // username:password. Returns true if an identity was found. |
| 96 bool SelectNextAuthIdentityToTry(); | 102 bool SelectNextAuthIdentityToTry(); |
| 97 | 103 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 | 154 |
| 149 std::set<HttpAuth::Scheme> disabled_schemes_; | 155 std::set<HttpAuth::Scheme> disabled_schemes_; |
| 150 | 156 |
| 151 CompletionCallbackImpl<HttpAuthController> io_callback_; | 157 CompletionCallbackImpl<HttpAuthController> io_callback_; |
| 152 CompletionCallback* user_callback_; | 158 CompletionCallback* user_callback_; |
| 153 }; | 159 }; |
| 154 | 160 |
| 155 } // namespace net | 161 } // namespace net |
| 156 | 162 |
| 157 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 163 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| OLD | NEW |