| Index: chrome/browser/history/history_backend.h
|
| diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h
|
| index d5a9fc4a1afa3f42d358ca71f773df7c7baba8b3..c37af46150c014b37f9a099a5f6d6a5e2f448314 100644
|
| --- a/chrome/browser/history/history_backend.h
|
| +++ b/chrome/browser/history/history_backend.h
|
| @@ -45,7 +45,7 @@ static const size_t kMaxFaviconsPerPage = 8;
|
|
|
| // The maximum number of bitmaps for a single icon URL which can be stored in
|
| // the thumbnail database.
|
| -static const size_t kMaxFaviconBitmapsPerIconURL = 8;
|
| +static const size_t kMaxFaviconRawBitmapsPerIconURL = 8;
|
|
|
| // *See the .cc file for more information on the design.*
|
| //
|
| @@ -216,26 +216,26 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
|
| int icon_types,
|
| int desired_size_in_dip,
|
| const std::vector<ui::ScaleFactor>& desired_scale_factors,
|
| - std::vector<favicon_base::FaviconBitmapResult>* bitmap_results);
|
| + std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results);
|
|
|
| void GetLargestFaviconForURL(
|
| const GURL& page_url,
|
| const std::vector<int>& icon_types,
|
| int minimum_size_in_pixels,
|
| - favicon_base::FaviconBitmapResult* bitmap_result);
|
| + favicon_base::FaviconRawBitmapResult* bitmap_result);
|
|
|
| void GetFaviconsForURL(
|
| const GURL& page_url,
|
| int icon_types,
|
| int desired_size_in_dip,
|
| const std::vector<ui::ScaleFactor>& desired_scale_factors,
|
| - std::vector<favicon_base::FaviconBitmapResult>* bitmap_results);
|
| + std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results);
|
|
|
| void GetFaviconForID(
|
| favicon_base::FaviconID favicon_id,
|
| int desired_size_in_dip,
|
| ui::ScaleFactor desired_scale_factor,
|
| - std::vector<favicon_base::FaviconBitmapResult>* bitmap_results);
|
| + std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results);
|
|
|
| void UpdateFaviconMappingsAndFetch(
|
| const GURL& page_url,
|
| @@ -243,7 +243,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
|
| int icon_types,
|
| int desired_size_in_dip,
|
| const std::vector<ui::ScaleFactor>& desired_scale_factors,
|
| - std::vector<favicon_base::FaviconBitmapResult>* bitmap_results);
|
| + std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results);
|
|
|
| void MergeFavicon(const GURL& page_url,
|
| const GURL& icon_url,
|
| @@ -251,10 +251,10 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
|
| scoped_refptr<base::RefCountedMemory> bitmap_data,
|
| const gfx::Size& pixel_size);
|
|
|
| - void SetFavicons(
|
| - const GURL& page_url,
|
| - favicon_base::IconType icon_type,
|
| - const std::vector<favicon_base::FaviconBitmapData>& favicon_bitmap_data);
|
| + void SetFavicons(const GURL& page_url,
|
| + favicon_base::IconType icon_type,
|
| + const std::vector<favicon_base::FaviconRawBitmapData>&
|
| + favicon_bitmap_data);
|
|
|
| void SetFaviconsOutOfDateForPage(const GURL& page_url);
|
|
|
| @@ -503,12 +503,12 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
|
| FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
|
| MergeFaviconIconURLMappedToDifferentPageURL);
|
| FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
|
| - MergeFaviconMaxFaviconBitmapsPerIconURL);
|
| + MergeFaviconMaxFaviconRawBitmapsPerIconURL);
|
| FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
|
| UpdateFaviconMappingsAndFetchMultipleIconTypes);
|
| FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBEmpty);
|
| FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
|
| - GetFaviconsFromDBNoFaviconBitmaps);
|
| + GetFaviconsFromDBNoFaviconRawBitmaps);
|
| FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
|
| GetFaviconsFromDBSelectClosestMatch);
|
| FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBSingleIconURL);
|
| @@ -652,7 +652,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
|
| int icon_types,
|
| int desired_size_in_dip,
|
| const std::vector<ui::ScaleFactor>& desired_scale_factors,
|
| - std::vector<favicon_base::FaviconBitmapResult>* results);
|
| + 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
|
| @@ -664,23 +664,24 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
|
| // 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(
|
| + void SetFaviconRawBitmaps(
|
| favicon_base::FaviconID icon_id,
|
| - const std::vector<favicon_base::FaviconBitmapData>& favicon_bitmap_data,
|
| + 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) FaviconBitmapData::bitmap_data contains non NULL bitmap data.
|
| + // kMaxFaviconRawBitmapsPerIconURL favicon bitmaps for each icon URL.
|
| + // 2) FaviconRawBitmapData::bitmap_data contains non NULL bitmap data.
|
| bool ValidateSetFaviconsParams(const std::vector<
|
| - favicon_base::FaviconBitmapData>& favicon_bitmap_data) const;
|
| + favicon_base::FaviconRawBitmapData>& favicon_bitmap_data) const;
|
|
|
| // Returns true if the bitmap data at |bitmap_id| equals |new_bitmap_data|.
|
| - bool IsFaviconBitmapDataEqual(
|
| - FaviconBitmapID bitmap_id,
|
| + bool IsFaviconRawBitmapDataEqual(
|
| + FaviconRawBitmapID bitmap_id,
|
| const scoped_refptr<base::RefCountedMemory>& new_bitmap_data);
|
|
|
| // Returns true if there are favicons for |page_url| and one of the types in
|
| @@ -699,22 +700,24 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
|
| int icon_types,
|
| const int desired_size_in_dip,
|
| const std::vector<ui::ScaleFactor>& desired_scale_factors,
|
| - std::vector<favicon_base::FaviconBitmapResult>* favicon_bitmap_results);
|
| + std::vector<favicon_base::FaviconRawBitmapResult>*
|
| + favicon_bitmap_results);
|
|
|
| // Returns the favicon bitmaps which most closely match |desired_size_in_dip|
|
| // and |desired_scale_factors| in |favicon_bitmap_results|. If
|
| // |desired_size_in_dip| is 0, only the largest favicon bitmap is returned.
|
| - // Goodness is computed via SelectFaviconBitmapIDs(). It is computed on a
|
| + // Goodness is computed via SelectFaviconRawBitmapIDs(). It is computed on a
|
| // per favicon id basis, thus all |favicon_bitmap_results| are guaranteed to
|
| // be for the same FaviconID. |favicon_bitmap_results| will have at most one
|
| // entry for each desired scale factor. There will be less entries if the same
|
| // favicon bitmap is the best result for multiple scale factors.
|
| // Returns true if there were no errors.
|
| - bool GetFaviconBitmapResultsForBestMatch(
|
| + bool GetFaviconRawBitmapResultsForBestMatch(
|
| const std::vector<favicon_base::FaviconID>& candidate_favicon_ids,
|
| int desired_size_in_dip,
|
| const std::vector<ui::ScaleFactor>& desired_scale_factors,
|
| - std::vector<favicon_base::FaviconBitmapResult>* favicon_bitmap_results);
|
| + std::vector<favicon_base::FaviconRawBitmapResult>*
|
| + favicon_bitmap_results);
|
|
|
| // Maps the favicon ids in |icon_ids| to |page_url| (and all redirects)
|
| // for |icon_type|.
|
|
|