| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 friend class base::RefCounted<HttpAuthController>; | 77 friend class base::RefCounted<HttpAuthController>; |
| 78 | 78 |
| 79 virtual ~HttpAuthController(); | 79 virtual ~HttpAuthController(); |
| 80 | 80 |
| 81 // Searches the auth cache for an entry that encompasses the request's path. | 81 // 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 | 82 // If such an entry is found, updates |identity_| and |handler_| with the |
| 83 // cache entry's data and returns true. | 83 // cache entry's data and returns true. |
| 84 bool SelectPreemptiveAuth(const BoundNetLog& net_log); | 84 bool SelectPreemptiveAuth(const BoundNetLog& net_log); |
| 85 | 85 |
| 86 // Invalidates the current handler, including cache. | 86 // Invalidates the current handler, including cache. |
| 87 void InvalidateCurrentHandler(); | 87 void InvalidateCurrentHandler(const HttpResponseHeaders* headers); |
| 88 | 88 |
| 89 // Invalidates any auth cache entries after authentication has failed. | 89 // Invalidates any auth cache entries after authentication has failed. |
| 90 // The identity that was rejected is |identity_|. | 90 // The identity that was rejected is |identity_|. |
| 91 void InvalidateRejectedAuthFromCache(); | 91 void InvalidateRejectedAuthFromCache(const HttpResponseHeaders* headers); |
| 92 | 92 |
| 93 // Sets |identity_| to the next identity that the transaction should try. It | 93 // 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 | 94 // chooses candidates by searching the auth cache and the URL for a |
| 95 // username:password. Returns true if an identity was found. | 95 // username:password. Returns true if an identity was found. |
| 96 bool SelectNextAuthIdentityToTry(); | 96 bool SelectNextAuthIdentityToTry(); |
| 97 | 97 |
| 98 // Populates auth_info_ with the challenge information, so that | 98 // Populates auth_info_ with the challenge information, so that |
| 99 // URLRequestHttpJob can prompt for a username/password. | 99 // URLRequestHttpJob can prompt for a username/password. |
| 100 void PopulateAuthChallenge(); | 100 void PopulateAuthChallenge(); |
| 101 | 101 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 std::set<HttpAuth::Scheme> disabled_schemes_; | 149 std::set<HttpAuth::Scheme> disabled_schemes_; |
| 150 | 150 |
| 151 CompletionCallbackImpl<HttpAuthController> io_callback_; | 151 CompletionCallbackImpl<HttpAuthController> io_callback_; |
| 152 CompletionCallback* user_callback_; | 152 CompletionCallback* user_callback_; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace net | 155 } // namespace net |
| 156 | 156 |
| 157 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 157 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| OLD | NEW |