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

Unified Diff: components/ntp_tiles/icon_cacher_impl.h

Issue 2873403002: [NTP Tiles] Avoid duplicate requests from IconCacherImpl (Closed)
Patch Set: Fix build for windows Created 3 years, 7 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
« no previous file with comments | « no previous file | components/ntp_tiles/icon_cacher_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/icon_cacher_impl.h
diff --git a/components/ntp_tiles/icon_cacher_impl.h b/components/ntp_tiles/icon_cacher_impl.h
index 52bd3fd373dcaa3397ddbcea0dd6a0872e57ac40..85d02b760f1e7ac6752aeecdfe85dfa62d3b5e07 100644
--- a/components/ntp_tiles/icon_cacher_impl.h
+++ b/components/ntp_tiles/icon_cacher_impl.h
@@ -6,7 +6,9 @@
#define COMPONENTS_NTP_TILES_ICON_CACHER_IMPL_H_
#include <memory>
+#include <set>
#include <string>
+#include <vector>
#include "base/callback.h"
#include "base/cancelable_callback.h"
@@ -58,37 +60,39 @@ class IconCacherImpl : public IconCacher {
void OnGetFaviconImageForPageURLFinished(
PopularSites::Site site,
- const base::Closure& icon_available,
const base::Closure& preliminary_icon_available,
const favicon_base::FaviconImageResult& result);
void OnPopularSitesFaviconDownloaded(
PopularSites::Site site,
std::unique_ptr<CancelableImageCallback> preliminary_callback,
- const base::Closure& icon_available,
const std::string& id,
const gfx::Image& fetched_image,
const image_fetcher::RequestMetadata& metadata);
std::unique_ptr<CancelableImageCallback> MaybeProvideDefaultIcon(
const PopularSites::Site& site,
- const base::Closure& icon_available);
- void SaveAndNotifyIconForSite(const PopularSites::Site& site,
- const base::Closure& icon_available,
- const gfx::Image& image);
+ const base::Closure& preliminary_icon_available);
+ void SaveAndNotifyDefaultIconForSite(
+ const PopularSites::Site& site,
+ const base::Closure& preliminary_icon_available,
+ const gfx::Image& image);
+ void SaveIconForSite(const PopularSites::Site& site, const gfx::Image& image);
void OnGetLargeIconOrFallbackStyleFinished(
const GURL& page_url,
- const base::Closure& icon_available,
const favicon_base::LargeIconResult& result);
- void OnMostLikelyFaviconDownloaded(const base::Closure& icon_available,
- bool success);
+ bool StartRequest(const GURL& request_url,
+ const base::Closure& icon_available);
+ void FinishRequestAndNotifyIconAvailable(const GURL& request_url,
+ bool newly_available);
base::CancelableTaskTracker tracker_;
favicon::FaviconService* const favicon_service_;
favicon::LargeIconService* const large_icon_service_;
std::unique_ptr<image_fetcher::ImageFetcher> const image_fetcher_;
+ std::map<GURL, std::vector<base::Closure>> in_flight_requests_;
base::WeakPtrFactory<IconCacherImpl> weak_ptr_factory_;
« no previous file with comments | « no previous file | components/ntp_tiles/icon_cacher_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698