| 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_CACHE_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_CACHE_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_CACHE_H_ | 6 #define NET_HTTP_HTTP_AUTH_CACHE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // |origin| - the {scheme, host, port} of the server. | 155 // |origin| - the {scheme, host, port} of the server. |
| 156 // |realm| - case sensitive realm string. | 156 // |realm| - case sensitive realm string. |
| 157 // |scheme| - the authentication scheme (i.e. basic, negotiate). | 157 // |scheme| - the authentication scheme (i.e. basic, negotiate). |
| 158 // |credentials| - the credentials to match. | 158 // |credentials| - the credentials to match. |
| 159 // returns - true if an entry was removed. | 159 // returns - true if an entry was removed. |
| 160 bool Remove(const GURL& origin, | 160 bool Remove(const GURL& origin, |
| 161 const std::string& realm, | 161 const std::string& realm, |
| 162 HttpAuth::Scheme scheme, | 162 HttpAuth::Scheme scheme, |
| 163 const AuthCredentials& credentials); | 163 const AuthCredentials& credentials); |
| 164 | 164 |
| 165 // Clears the cache. | 165 // Clears cache entries created within time period defined by |delete_begin| |
| 166 void Clear(); | 166 // and |delete_end|. |
| 167 void Clear(base::Time delete_begin, base::Time delete_end); |
| 167 | 168 |
| 168 // Updates a stale digest entry on server |origin| for realm |realm| and | 169 // Updates a stale digest entry on server |origin| for realm |realm| and |
| 169 // scheme |scheme|. The cached auth challenge is replaced with | 170 // scheme |scheme|. The cached auth challenge is replaced with |
| 170 // |auth_challenge| and the nonce count is reset. | 171 // |auth_challenge| and the nonce count is reset. |
| 171 // |UpdateStaleChallenge()| returns true if a matching entry exists in the | 172 // |UpdateStaleChallenge()| returns true if a matching entry exists in the |
| 172 // cache, false otherwise. | 173 // cache, false otherwise. |
| 173 bool UpdateStaleChallenge(const GURL& origin, | 174 bool UpdateStaleChallenge(const GURL& origin, |
| 174 const std::string& realm, | 175 const std::string& realm, |
| 175 HttpAuth::Scheme scheme, | 176 HttpAuth::Scheme scheme, |
| 176 const std::string& auth_challenge); | 177 const std::string& auth_challenge); |
| 177 | 178 |
| 178 // Copies all entries from |other| cache. | 179 // Copies all entries from |other| cache. |
| 179 void UpdateAllFrom(const HttpAuthCache& other); | 180 void UpdateAllFrom(const HttpAuthCache& other); |
| 180 | 181 |
| 181 private: | 182 private: |
| 182 typedef std::list<Entry> EntryList; | 183 typedef std::list<Entry> EntryList; |
| 183 EntryList entries_; | 184 EntryList entries_; |
| 184 }; | 185 }; |
| 185 | 186 |
| 186 // An authentication realm entry. | 187 // An authentication realm entry. |
| 187 } // namespace net | 188 } // namespace net |
| 188 | 189 |
| 189 #endif // NET_HTTP_HTTP_AUTH_CACHE_H_ | 190 #endif // NET_HTTP_HTTP_AUTH_CACHE_H_ |
| OLD | NEW |