| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 protected: // So that we can mock this object. | 74 protected: // So that we can mock this object. |
| 75 friend class base::RefCounted<HttpAuthController>; | 75 friend class base::RefCounted<HttpAuthController>; |
| 76 virtual ~HttpAuthController(); | 76 virtual ~HttpAuthController(); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 // Searches the auth cache for an entry that encompasses the request's path. | 79 // Searches the auth cache for an entry that encompasses the request's path. |
| 80 // If such an entry is found, updates |identity_| and |handler_| with the | 80 // If such an entry is found, updates |identity_| and |handler_| with the |
| 81 // cache entry's data and returns true. | 81 // cache entry's data and returns true. |
| 82 bool SelectPreemptiveAuth(const BoundNetLog& net_log); | 82 bool SelectPreemptiveAuth(const BoundNetLog& net_log); |
| 83 | 83 |
| 84 // Invalidates the current handler, including cache. |
| 85 void InvalidateCurrentHandler(); |
| 86 |
| 84 // Invalidates any auth cache entries after authentication has failed. | 87 // Invalidates any auth cache entries after authentication has failed. |
| 85 // The identity that was rejected is |identity_|. | 88 // The identity that was rejected is |identity_|. |
| 86 void InvalidateRejectedAuthFromCache(); | 89 void InvalidateRejectedAuthFromCache(); |
| 87 | 90 |
| 88 // Sets |identity_| to the next identity that the transaction should try. It | 91 // Sets |identity_| to the next identity that the transaction should try. It |
| 89 // chooses candidates by searching the auth cache and the URL for a | 92 // chooses candidates by searching the auth cache and the URL for a |
| 90 // username:password. Returns true if an identity was found. | 93 // username:password. Returns true if an identity was found. |
| 91 bool SelectNextAuthIdentityToTry(); | 94 bool SelectNextAuthIdentityToTry(); |
| 92 | 95 |
| 93 // Populates auth_info_ with the challenge information, so that | 96 // Populates auth_info_ with the challenge information, so that |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 142 |
| 140 std::set<std::string> disabled_schemes_; | 143 std::set<std::string> disabled_schemes_; |
| 141 | 144 |
| 142 CompletionCallbackImpl<HttpAuthController> io_callback_; | 145 CompletionCallbackImpl<HttpAuthController> io_callback_; |
| 143 CompletionCallback* user_callback_; | 146 CompletionCallback* user_callback_; |
| 144 }; | 147 }; |
| 145 | 148 |
| 146 } // namespace net | 149 } // namespace net |
| 147 | 150 |
| 148 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 151 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| OLD | NEW |