| 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 COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ |
| 6 #define COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 void RollbackTransaction(); | 59 void RollbackTransaction(); |
| 60 | 60 |
| 61 // Vacuums the database. This will cause sqlite to defragment and collect | 61 // Vacuums the database. This will cause sqlite to defragment and collect |
| 62 // unused space in the file. It can be VERY SLOW. | 62 // unused space in the file. It can be VERY SLOW. |
| 63 void Vacuum(); | 63 void Vacuum(); |
| 64 | 64 |
| 65 // Try to trim the cache memory used by the database. If |aggressively| is | 65 // Try to trim the cache memory used by the database. If |aggressively| is |
| 66 // true try to trim all unused cache, otherwise trim by half. | 66 // true try to trim all unused cache, otherwise trim by half. |
| 67 void TrimMemory(bool aggressively); | 67 void TrimMemory(bool aggressively); |
| 68 | 68 |
| 69 // Delete all on-demand favicon bitmaps that have not been requested long |
| 70 // (i.e. not after |deletion_threshold|). Do not delete bitmaps for URLs |
| 71 // that are bookmarked in |bookmark_model|. Furthermore, delete all favicons |
| 72 // with no corresponding bitmap and all mappings with no corresponding |
| 73 // favicon. |
| 74 void ClearOldOnDemandFavicons(base::Time deletion_threshold); |
| 75 void ClearOldOnDemandFaviconsOneByOne(base::Time deletion_threshold); |
| 76 void ClearOldOnDemandFaviconsNoJoin(base::Time deletion_threshold); |
| 77 |
| 69 // Favicon Bitmaps ----------------------------------------------------------- | 78 // Favicon Bitmaps ----------------------------------------------------------- |
| 70 | 79 |
| 71 // Returns true if there are favicon bitmaps for |icon_id|. If | 80 // Returns true if there are favicon bitmaps for |icon_id|. If |
| 72 // |bitmap_id_sizes| is non NULL, sets it to a list of the favicon bitmap ids | 81 // |bitmap_id_sizes| is non NULL, sets it to a list of the favicon bitmap ids |
| 73 // and their associated pixel sizes for the favicon with |icon_id|. | 82 // and their associated pixel sizes for the favicon with |icon_id|. |
| 74 // The list contains results for the bitmaps which are cached in the | 83 // The list contains results for the bitmaps which are cached in the |
| 75 // favicon_bitmaps table. The pixel sizes are a subset of the sizes in the | 84 // favicon_bitmaps table. The pixel sizes are a subset of the sizes in the |
| 76 // 'sizes' field of the favicons table for |icon_id|. | 85 // 'sizes' field of the favicons table for |icon_id|. |
| 77 bool GetFaviconBitmapIDSizes( | 86 bool GetFaviconBitmapIDSizes( |
| 78 favicon_base::FaviconID icon_id, | 87 favicon_base::FaviconID icon_id, |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 286 |
| 278 sql::Connection db_; | 287 sql::Connection db_; |
| 279 sql::MetaTable meta_table_; | 288 sql::MetaTable meta_table_; |
| 280 | 289 |
| 281 HistoryBackendClient* backend_client_; | 290 HistoryBackendClient* backend_client_; |
| 282 }; | 291 }; |
| 283 | 292 |
| 284 } // namespace history | 293 } // namespace history |
| 285 | 294 |
| 286 #endif // COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ | 295 #endif // COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ |
| OLD | NEW |