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

Unified Diff: components/history/core/browser/history_service.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, 6 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_service.h
diff --git a/components/history/core/browser/history_service.h b/components/history/core/browser/history_service.h
index 947ad23567ca396ff3a3943531c89f168a46ff91..5e626f56feec82c7ee2fcd8231bf1a4c0b03ad44 100644
--- a/components/history/core/browser/history_service.h
+++ b/components/history/core/browser/history_service.h
@@ -458,14 +458,20 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
scoped_ptr<HistoryDBTask> task,
base::CancelableTaskTracker* tracker);
- // This callback is invoked when favicon change for urls.
- typedef base::Callback<void(const std::set<GURL>&)> OnFaviconChangedCallback;
+ // Callback for when favicon data changes. The first std::vector contains a
sky 2015/06/19 16:38:02 Is there a reason why these are vectors and not se
pkotwicz 2015/06/21 22:16:09 I used std::vectors because we do not call std::se
+ // list of page URLs for which the favicon data has changed. The second
+ // std::vector contains a list of icon URLs for which the favicon data has
+ // changed.
+ typedef base::Callback<void(const std::vector<GURL>&,
+ const std::vector<GURL>&)>
+ OnFaviconsChangedCallback;
// Add a callback to the list. The callback will remain registered until the
- // returned Subscription is destroyed. This must occurs before HistoryService
- // is destroyed.
- scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription>
- AddFaviconChangedCallback(const OnFaviconChangedCallback& callback)
+ // returned Subscription is destroyed. The Subscription must be destroyed
+ // before HistoryService is destroyed.
+ scoped_ptr<base::CallbackList<void(const std::vector<GURL>&,
+ const std::vector<GURL>&)>::Subscription>
+ AddFaviconsChangedCallback(const OnFaviconsChangedCallback& callback)
WARN_UNUSED_RESULT;
// Testing -------------------------------------------------------------------
@@ -780,8 +786,11 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
// specified priority. The task will have ownership taken.
void ScheduleTask(SchedulePriority priority, const base::Closure& task);
- // Invokes all callback registered by AddFaviconChangedCallback.
- void NotifyFaviconChanged(const std::set<GURL>& changed_favicons);
+ // Called when 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.
+ void NotifyFaviconsChanged(const std::vector<GURL>& page_urls,
+ const std::vector<GURL>& icon_urls);
base::ThreadChecker thread_checker_;
@@ -816,7 +825,7 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
bool backend_loaded_;
base::ObserverList<HistoryServiceObserver> observers_;
- base::CallbackList<void(const std::set<GURL>&)>
+ base::CallbackList<void(const std::vector<GURL>&, const std::vector<GURL>&)>
favicon_changed_callback_list_;
DeleteDirectiveHandler delete_directive_handler_;

Powered by Google App Engine
This is Rietveld 408576698