diff options
author | kaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-12 02:31:58 +0000 |
---|---|---|
committer | kaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-12 02:31:58 +0000 |
commit | a55e85b04332ce155fd0bb279f77b764ea7a9cd4 (patch) | |
tree | 9600be7802858b5936f29f0fd0ecaf06a556b138 /chrome/browser/history/history_backend.h | |
parent | 3e1e3b069d932dffce222311b331c98679a4d985 (diff) | |
download | chromium_src-a55e85b04332ce155fd0bb279f77b764ea7a9cd4.zip chromium_src-a55e85b04332ce155fd0bb279f77b764ea7a9cd4.tar.gz chromium_src-a55e85b04332ce155fd0bb279f77b764ea7a9cd4.tar.bz2 |
Finish converting FaviconService to use CancelableTaskTracker.
This is continuation of https://codereview.chromium.org/11421188/
FaviconService functions converted:
GetFaviconImage (used by c/b/ui/search_engines/template_url_table_model.cc)
GetRawFavicon (used by c/b/ui/webui/favicon_source.cc)
GetFavicon (used by c/b/favicon/favicon_handler.cc)
UpdateFaviconMappingsAndFetch (used by c/b/favicon/favicon_handler.cc)
GetLargestRawFaviconForID (used by c/b/history/android/sqlite_cursor.cc)
-------- these functions depend on -------
HistoryService::GetFavicons
HistoryService::UpdateFaviconMappingsAndFetch
HistoryService::GetFaviconForID
-------- which depends on -------
HistoryBackend::GetFavicons
HistoryBackend::UpdateFaviconMappingsAndFetch
HistoryBackend::GetFaviconForID
BUG=155883
Review URL: https://chromiumcodereview.appspot.com/11489002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/history_backend.h')
-rw-r--r-- | chrome/browser/history/history_backend.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index 43d9d92..ab0acb8 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -257,33 +257,41 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // Favicon ------------------------------------------------------------------- - void GetFavicons(scoped_refptr<GetFaviconRequest> request, - const std::vector<GURL>& icon_urls, - int icon_types, - int desired_size_in_dip, - const std::vector<ui::ScaleFactor>& desired_scale_factors); + struct FaviconResults { + FaviconResults(); + ~FaviconResults(); + void Clear(); + + std::vector<history::FaviconBitmapResult> bitmap_results; + IconURLSizesMap size_map; + }; + + void GetFavicons(const std::vector<GURL>& icon_urls, + int icon_types, + int desired_size_in_dip, + const std::vector<ui::ScaleFactor>& desired_scale_factors, + FaviconResults* results); void GetFaviconsForURL( const GURL& page_url, int icon_types, int desired_size_in_dip, const std::vector<ui::ScaleFactor>& desired_scale_factors, - std::vector<history::FaviconBitmapResult>* bitmap_results, - IconURLSizesMap* size_map); + FaviconResults* results); void GetFaviconForID( - scoped_refptr<GetFaviconRequest> request, FaviconID favicon_id, int desired_size_in_dip, - ui::ScaleFactor desired_scale_factor); + ui::ScaleFactor desired_scale_factor, + FaviconResults* results); void UpdateFaviconMappingsAndFetch( - scoped_refptr<GetFaviconRequest> request, const GURL& page_url, const std::vector<GURL>& icon_urls, int icon_types, int desired_size_in_dip, - const std::vector<ui::ScaleFactor>& desired_scale_factors); + const std::vector<ui::ScaleFactor>& desired_scale_factors, + FaviconResults* results); void MergeFavicon(const GURL& page_url, const GURL& icon_url, @@ -657,12 +665,12 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // If multiple icon types are specified, |page_url| will be mapped to the // icon URLs of the largest type available in the database. void UpdateFaviconMappingsAndFetchImpl( - scoped_refptr<GetFaviconRequest> request, const GURL* page_url, const std::vector<GURL>& icon_urls, int icon_types, int desired_size_in_dip, - const std::vector<ui::ScaleFactor>& desired_scale_factors); + const std::vector<ui::ScaleFactor>& desired_scale_factors, + FaviconResults* results); // Set the favicon bitmaps for |icon_id|. // For each entry in |favicon_bitmap_data|, if a favicon bitmap already |