OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DNS_HOST_CACHE_H_ | 5 #ifndef NET_DNS_HOST_CACHE_H_ |
6 #define NET_DNS_HOST_CACHE_H_ | 6 #define NET_DNS_HOST_CACHE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <functional> | 10 #include <functional> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 base::TimeTicks now, | 160 base::TimeTicks now, |
161 base::TimeDelta ttl); | 161 base::TimeDelta ttl); |
162 | 162 |
163 // Marks all entries as stale on account of a network change. | 163 // Marks all entries as stale on account of a network change. |
164 void OnNetworkChange(); | 164 void OnNetworkChange(); |
165 | 165 |
166 void set_eviction_callback(const EvictionCallback& callback) { | 166 void set_eviction_callback(const EvictionCallback& callback) { |
167 eviction_callback_ = callback; | 167 eviction_callback_ = callback; |
168 } | 168 } |
169 | 169 |
170 void set_persistence_delegate(PersistenceDelegate* delegate) { | 170 void set_persistence_delegate(PersistenceDelegate* delegate); |
171 delegate_ = delegate; | |
172 } | |
173 | 171 |
174 // Empties the cache. | 172 // Empties the cache. |
175 void clear(); | 173 void clear(); |
176 | 174 |
177 // Clears hosts matching |host_filter| from the cache. | 175 // Clears hosts matching |host_filter| from the cache. |
178 void ClearForHosts( | 176 void ClearForHosts( |
179 const base::Callback<bool(const std::string&)>& host_filter); | 177 const base::Callback<bool(const std::string&)>& host_filter); |
180 | 178 |
181 // Returns the contents of the cache represented as a base::ListValue for | 179 // Returns the contents of the cache represented as a base::ListValue for |
182 // serialization. | 180 // serialization. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 PersistenceDelegate* delegate_; | 234 PersistenceDelegate* delegate_; |
237 | 235 |
238 THREAD_CHECKER(thread_checker_); | 236 THREAD_CHECKER(thread_checker_); |
239 | 237 |
240 DISALLOW_COPY_AND_ASSIGN(HostCache); | 238 DISALLOW_COPY_AND_ASSIGN(HostCache); |
241 }; | 239 }; |
242 | 240 |
243 } // namespace net | 241 } // namespace net |
244 | 242 |
245 #endif // NET_DNS_HOST_CACHE_H_ | 243 #endif // NET_DNS_HOST_CACHE_H_ |
OLD | NEW |