| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_THUMBNAIL_DATABASE_H__ | 5 #ifndef CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H__ |
| 6 #define CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H__ | 6 #define CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H__ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/history/history_types.h" | 10 #include "chrome/browser/history/history_types.h" |
| 11 #include "chrome/browser/history/url_database.h" // For DBCloseScoper. | 11 #include "chrome/browser/history/url_database.h" // For DBCloseScoper. |
| 12 #include "chrome/browser/meta_table_helper.h" | 12 #include "chrome/browser/meta_table_helper.h" |
| 13 #include "chrome/common/sqlite_compiled_statement.h" | 13 #include "chrome/common/sqlite_compiled_statement.h" |
| 14 #include "skia/include/SkBitmap.h" | 14 #include "skia/include/SkBitmap.h" |
| 15 | 15 |
| 16 struct sqlite3; | 16 struct sqlite3; |
| 17 struct ThumbnailScore; | 17 struct ThumbnailScore; |
| 18 class Time; | 18 class base::Time; |
| 19 | 19 |
| 20 namespace history { | 20 namespace history { |
| 21 | 21 |
| 22 class ExpireHistoryBackend; | 22 class ExpireHistoryBackend; |
| 23 | 23 |
| 24 // This database interface is owned by the history backend and runs on the | 24 // This database interface is owned by the history backend and runs on the |
| 25 // history thread. It is a totally separate component from history partially | 25 // history thread. It is a totally separate component from history partially |
| 26 // because we may want to move it to its own thread in the future. The | 26 // because we may want to move it to its own thread in the future. The |
| 27 // operations we will do on this database will be slow, but we can tolerate | 27 // operations we will do on this database will be slow, but we can tolerate |
| 28 // higher latency (it's OK for thumbnails to come in slower than the rest | 28 // higher latency (it's OK for thumbnails to come in slower than the rest |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Returns true on success. | 73 // Returns true on success. |
| 74 bool RecreateThumbnailTable(); | 74 bool RecreateThumbnailTable(); |
| 75 | 75 |
| 76 // FavIcons ------------------------------------------------------------------ | 76 // FavIcons ------------------------------------------------------------------ |
| 77 | 77 |
| 78 // Sets the bits for a favicon. This should be png encoded data. | 78 // Sets the bits for a favicon. This should be png encoded data. |
| 79 // The time indicates the access time, and is used to detect when the favicon | 79 // The time indicates the access time, and is used to detect when the favicon |
| 80 // should be refreshed. | 80 // should be refreshed. |
| 81 bool SetFavIcon(FavIconID icon_id, | 81 bool SetFavIcon(FavIconID icon_id, |
| 82 const std::vector<unsigned char>& icon_data, | 82 const std::vector<unsigned char>& icon_data, |
| 83 Time time); | 83 base::Time time); |
| 84 | 84 |
| 85 // Sets the time the favicon was last updated. | 85 // Sets the time the favicon was last updated. |
| 86 bool SetFavIconLastUpdateTime(FavIconID icon_id, const Time& time); | 86 bool SetFavIconLastUpdateTime(FavIconID icon_id, const base::Time& time); |
| 87 | 87 |
| 88 // Returns the id of the entry in the favicon database with the specified url. | 88 // Returns the id of the entry in the favicon database with the specified url. |
| 89 // Returns 0 if no entry exists for the specified url. | 89 // Returns 0 if no entry exists for the specified url. |
| 90 FavIconID GetFavIconIDForFavIconURL(const GURL& icon_url); | 90 FavIconID GetFavIconIDForFavIconURL(const GURL& icon_url); |
| 91 | 91 |
| 92 // Gets the png encoded favicon and last updated time for the specified | 92 // Gets the png encoded favicon and last updated time for the specified |
| 93 // favicon id. | 93 // favicon id. |
| 94 bool GetFavIcon(FavIconID icon_id, | 94 bool GetFavIcon(FavIconID icon_id, |
| 95 Time* last_updated, | 95 base::Time* last_updated, |
| 96 std::vector<unsigned char>* png_icon_data, | 96 std::vector<unsigned char>* png_icon_data, |
| 97 GURL* icon_url); | 97 GURL* icon_url); |
| 98 | 98 |
| 99 // Adds the favicon URL to the favicon db, returning its id. | 99 // Adds the favicon URL to the favicon db, returning its id. |
| 100 FavIconID AddFavIcon(const GURL& icon_url); | 100 FavIconID AddFavIcon(const GURL& icon_url); |
| 101 | 101 |
| 102 // Delete the favicon with the provided id. Returns false on failure | 102 // Delete the favicon with the provided id. Returns false on failure |
| 103 bool DeleteFavIcon(FavIconID id); | 103 bool DeleteFavIcon(FavIconID id); |
| 104 | 104 |
| 105 // Temporary FavIcons -------------------------------------------------------- | 105 // Temporary FavIcons -------------------------------------------------------- |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 int transaction_nesting_; | 158 int transaction_nesting_; |
| 159 | 159 |
| 160 MetaTableHelper meta_table_; | 160 MetaTableHelper meta_table_; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace history | 163 } // namespace history |
| 164 | 164 |
| 165 #endif // CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H__ | 165 #endif // CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H__ |
| 166 | 166 |
| OLD | NEW |