Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: chrome/browser/history/history_backend.h

Issue 531493002: Move encoding SkBitmaps to PNG out of FaviconService::SetFavicons() and onto the history thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/history_backend.h
diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h
index d462b2ecee302da0f863265a16192aa4d1f5bf62..f7735ec6c4646cc39c1888165feca8557658d60e 100644
--- a/chrome/browser/history/history_backend.h
+++ b/chrome/browser/history/history_backend.h
@@ -33,6 +33,7 @@
class HistoryURLProvider;
struct HistoryURLProviderParams;
struct ImportedFaviconUsage;
+class SkBitmap;
class TestingProfile;
struct ThumbnailScore;
@@ -266,8 +267,8 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
void SetFavicons(const GURL& page_url,
favicon_base::IconType icon_type,
- const std::vector<favicon_base::FaviconRawBitmapData>&
- favicon_bitmap_data);
+ const GURL& icon_url,
+ const std::vector<SkBitmap>& bitmaps);
void SetFaviconsOutOfDateForPage(const GURL& page_url);
@@ -546,7 +547,6 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
GetFaviconsFromDBNoFaviconBitmaps);
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
GetFaviconsFromDBSelectClosestMatch);
- FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBSingleIconURL);
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBIconType);
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBExpired);
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
@@ -689,28 +689,15 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
std::vector<favicon_base::FaviconRawBitmapResult>* results);
// Set the favicon bitmaps for |icon_id|.
- // For each entry in |favicon_bitmap_data|, if a favicon bitmap already
- // exists at the entry's pixel size, replace the favicon bitmap's data with
- // the entry's bitmap data. Otherwise add a new favicon bitmap.
- // Any favicon bitmaps already mapped to |icon_id| whose pixel sizes are not
- // in |favicon_bitmap_data| are deleted.
- // If not NULL, |favicon_bitmaps_changed| is set to whether any of the bitmap
- // data at |icon_id| is changed as a result of calling this method.
- // Computing |favicon_bitmaps_changed| requires additional database queries
- // so should be avoided if unnecessary.
- void SetFaviconBitmaps(favicon_base::FaviconID icon_id,
- const std::vector<favicon_base::FaviconRawBitmapData>&
- favicon_bitmap_data,
- bool* favicon_bitmaps_changed);
-
- // Returns true if |favicon_bitmap_data| passed to SetFavicons() is valid.
- // Criteria:
- // 1) |favicon_bitmap_data| contains no more than
- // kMaxFaviconsPerPage unique icon URLs.
- // kMaxFaviconBitmapsPerIconURL favicon bitmaps for each icon URL.
- // 2) FaviconRawBitmapData::bitmap_data contains non NULL bitmap data.
- bool ValidateSetFaviconsParams(const std::vector<
- favicon_base::FaviconRawBitmapData>& favicon_bitmap_data) const;
+ // For each entry in |bitmaps|, if a favicon bitmap already exists at the
+ // entry's pixel size, replace the favicon bitmap's data with the entry's
+ // bitmap data. Otherwise add a new favicon bitmap.
+ // Any favicon bitmaps already mapped to |icon_id| whose pixel size does not
+ // match the pixel size of one of |bitmaps| is deleted.
+ // Returns true if any of the bitmap data at |icon_id| is changed as a result
+ // of calling this method.
+ bool SetFaviconBitmaps(favicon_base::FaviconID icon_id,
+ const std::vector<SkBitmap>& bitmaps);
// Returns true if the bitmap data at |bitmap_id| equals |new_bitmap_data|.
bool IsFaviconBitmapDataEqual(
« no previous file with comments | « chrome/browser/history/android/android_provider_backend_unittest.cc ('k') | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698