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 CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // the unit tests. | 246 // the unit tests. |
247 const ExpiringVisitsReader* GetAutoSubframeVisitsReader(); | 247 const ExpiringVisitsReader* GetAutoSubframeVisitsReader(); |
248 | 248 |
249 // Non-owning pointer to the notification delegate (guaranteed non-NULL). | 249 // Non-owning pointer to the notification delegate (guaranteed non-NULL). |
250 BroadcastNotificationDelegate* delegate_; | 250 BroadcastNotificationDelegate* delegate_; |
251 | 251 |
252 // Non-owning pointers to the databases we deal with (MAY BE NULL). | 252 // Non-owning pointers to the databases we deal with (MAY BE NULL). |
253 HistoryDatabase* main_db_; // Main history database. | 253 HistoryDatabase* main_db_; // Main history database. |
254 ThumbnailDatabase* thumb_db_; // Thumbnails and favicons. | 254 ThumbnailDatabase* thumb_db_; // Thumbnails and favicons. |
255 | 255 |
256 // Used to generate runnable methods to do timers on this class. They will be | |
257 // automatically canceled when this class is deleted. | |
258 base::WeakPtrFactory<ExpireHistoryBackend> weak_factory_; | |
259 | |
260 // The threshold for "old" history where we will automatically delete it. | 256 // The threshold for "old" history where we will automatically delete it. |
261 base::TimeDelta expiration_threshold_; | 257 base::TimeDelta expiration_threshold_; |
262 | 258 |
263 // List of all distinct types of readers. This list is used to populate the | 259 // List of all distinct types of readers. This list is used to populate the |
264 // work queue. | 260 // work queue. |
265 ExpiringVisitsReaders readers_; | 261 ExpiringVisitsReaders readers_; |
266 | 262 |
267 // Work queue for periodic expiration tasks, used by DoExpireIteration() to | 263 // Work queue for periodic expiration tasks, used by DoExpireIteration() to |
268 // determine what to do at an iteration, as well as populate it for future | 264 // determine what to do at an iteration, as well as populate it for future |
269 // iterations. | 265 // iterations. |
270 std::queue<const ExpiringVisitsReader*> work_queue_; | 266 std::queue<const ExpiringVisitsReader*> work_queue_; |
271 | 267 |
272 // Readers for various types of visits. | 268 // Readers for various types of visits. |
273 // TODO(dglazkov): If you are adding another one, please consider reorganizing | 269 // TODO(dglazkov): If you are adding another one, please consider reorganizing |
274 // into a map. | 270 // into a map. |
275 scoped_ptr<ExpiringVisitsReader> all_visits_reader_; | 271 scoped_ptr<ExpiringVisitsReader> all_visits_reader_; |
276 scoped_ptr<ExpiringVisitsReader> auto_subframe_visits_reader_; | 272 scoped_ptr<ExpiringVisitsReader> auto_subframe_visits_reader_; |
277 | 273 |
278 // The HistoryClient; may be NULL. | 274 // The HistoryClient; may be NULL. |
279 // | 275 // |
280 // Use GetHistoryClient to access this, which makes sure the bookmarks are | 276 // Use GetHistoryClient to access this, which makes sure the bookmarks are |
281 // loaded before returning. | 277 // loaded before returning. |
282 HistoryClient* history_client_; | 278 HistoryClient* history_client_; |
283 | 279 |
| 280 // Used to generate runnable methods to do timers on this class. They will be |
| 281 // automatically canceled when this class is deleted. |
| 282 base::WeakPtrFactory<ExpireHistoryBackend> weak_factory_; |
| 283 |
284 DISALLOW_COPY_AND_ASSIGN(ExpireHistoryBackend); | 284 DISALLOW_COPY_AND_ASSIGN(ExpireHistoryBackend); |
285 }; | 285 }; |
286 | 286 |
287 } // namespace history | 287 } // namespace history |
288 | 288 |
289 #endif // CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ | 289 #endif // CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ |
OLD | NEW |