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