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

Unified Diff: components/history/core/browser/history_backend.h

Issue 1133463005: Update all bookmarks which use an icon URL when a favicon's bitmap is updated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@startup_do_not_unexpire
Patch Set: Created 5 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
Index: components/history/core/browser/history_backend.h
diff --git a/components/history/core/browser/history_backend.h b/components/history/core/browser/history_backend.h
index 476008d2326924bb75ae012fa9f48dc002eedd54..463f2b2ded444cc111b11f832517aa8137330d0d 100644
--- a/components/history/core/browser/history_backend.h
+++ b/components/history/core/browser/history_backend.h
@@ -120,9 +120,12 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
virtual void SetInMemoryBackend(
scoped_ptr<InMemoryHistoryBackend> backend) = 0;
- // Notify HistoryService that some URLs favicon changed that will forward
- // the events to the FaviconChangedObservers in the correct thread.
- virtual void NotifyFaviconChanged(const std::set<GURL>& urls) = 0;
+ // Notify HistoryService that the favicons for the given page URLs (e.g.
+ // http://www.google.com) and the given icon URLs (e.g.
+ // http://www.google.com/favicon.ico) have changed. HistoryService notifies
+ // any registered callbacks.
+ virtual void NotifyFaviconsChanged(const std::vector<GURL>& page_urls,
+ const std::vector<GURL>& icon_urls) = 0;
// Notify HistoryService that the user is visiting an URL. The event will
// be forwarded to the HistoryServiceObservers in the correct thread.
@@ -492,6 +495,18 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
MergeFaviconMaxFaviconBitmapsPerIconURL);
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
+ FaviconChangedNotificationNewFavicon);
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
+ FaviconChangedNotificationBitmapDataChanged);
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
+ FaviconChangedNotificationIconMappingChanged);
+ FRIEND_TEST_ALL_PREFIXES(
+ HistoryBackendTest,
+ FaviconChangedNotificationIconMappingAndBitmapDataChanged);
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
+ FaviconChangedNotificationsMergeCopy);
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, NoFaviconChangedNotifications);
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
UpdateFaviconMappingsAndFetchMultipleIconTypes);
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBEmpty);
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
@@ -691,9 +706,16 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
RedirectList* redirect_list);
// Send notification that the favicon has changed for |page_url| and all its
- // redirects.
+ // redirects. This should be called if the mapping between the page URL
+ // (e.g. http://www.google.com) and the icon URL (e.g.
+ // http://www.google.com/favicon.ico) has changed.
void SendFaviconChangedNotificationForPageAndRedirects(const GURL& page_url);
+ // Send notification that the bitmap data for the favicon at |icon_url| has
+ // changed. Sending this notification is important because the favicon at
+ // |icon_url| may be mapped to hundreds of page URLs.
+ void SendFaviconChangedNotificationForIconURL(const GURL& icon_url);
+
// Generic stuff -------------------------------------------------------------
// Processes the next scheduled HistoryDBTask, scheduling this method
@@ -701,7 +723,8 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
void ProcessDBTaskImpl();
// HistoryBackendNotifier:
- void NotifyFaviconChanged(const std::set<GURL>& urls) override;
+ void NotifyFaviconsChanged(const std::vector<GURL>& page_urls,
+ const std::vector<GURL>& icon_urls) override;
void NotifyURLVisited(ui::PageTransition transition,
const URLRow& row,
const RedirectList& redirects,

Powered by Google App Engine
This is Rietveld 408576698