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

Side by Side Diff: components/history/core/browser/history_service.cc

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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The history system runs on a background thread so that potentially slow 5 // The history system runs on a background thread so that potentially slow
6 // database operations don't delay the browser. This backend processing is 6 // database operations don't delay the browser. This backend processing is
7 // represented by HistoryBackend. The HistoryService's job is to dispatch to 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to
8 // that thread. 8 // that thread.
9 // 9 //
10 // Main thread History thread 10 // Main thread History thread
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 history_service_, init_status)); 111 history_service_, init_status));
112 } 112 }
113 113
114 void SetInMemoryBackend(scoped_ptr<InMemoryHistoryBackend> backend) override { 114 void SetInMemoryBackend(scoped_ptr<InMemoryHistoryBackend> backend) override {
115 // Send the backend to the history service on the main thread. 115 // Send the backend to the history service on the main thread.
116 service_task_runner_->PostTask( 116 service_task_runner_->PostTask(
117 FROM_HERE, base::Bind(&HistoryService::SetInMemoryBackend, 117 FROM_HERE, base::Bind(&HistoryService::SetInMemoryBackend,
118 history_service_, base::Passed(&backend))); 118 history_service_, base::Passed(&backend)));
119 } 119 }
120 120
121 void NotifyFaviconChanged(const std::set<GURL>& urls) override { 121 void NotifyFaviconsChanged(const std::set<GURL>& page_urls,
122 const std::set<GURL>& icon_urls) override {
122 // Send the notification to the history service on the main thread. 123 // Send the notification to the history service on the main thread.
123 service_task_runner_->PostTask( 124 service_task_runner_->PostTask(
124 FROM_HERE, base::Bind(&HistoryService::NotifyFaviconChanged, 125 FROM_HERE, base::Bind(&HistoryService::NotifyFaviconsChanged,
125 history_service_, urls)); 126 history_service_, page_urls, icon_urls));
126 } 127 }
127 128
128 void NotifyURLVisited(ui::PageTransition transition, 129 void NotifyURLVisited(ui::PageTransition transition,
129 const URLRow& row, 130 const URLRow& row,
130 const RedirectList& redirects, 131 const RedirectList& redirects,
131 base::Time visit_time) override { 132 base::Time visit_time) override {
132 service_task_runner_->PostTask( 133 service_task_runner_->PostTask(
133 FROM_HERE, 134 FROM_HERE,
134 base::Bind(&HistoryService::NotifyURLVisited, history_service_, 135 base::Bind(&HistoryService::NotifyURLVisited, history_service_,
135 transition, row, redirects, visit_time)); 136 transition, row, redirects, visit_time));
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_, 1116 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_,
1116 OnKeywordSearchTermUpdated(this, row, keyword_id, term)); 1117 OnKeywordSearchTermUpdated(this, row, keyword_id, term));
1117 } 1118 }
1118 1119
1119 void HistoryService::NotifyKeywordSearchTermDeleted(URLID url_id) { 1120 void HistoryService::NotifyKeywordSearchTermDeleted(URLID url_id) {
1120 DCHECK(thread_checker_.CalledOnValidThread()); 1121 DCHECK(thread_checker_.CalledOnValidThread());
1121 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_, 1122 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_,
1122 OnKeywordSearchTermDeleted(this, url_id)); 1123 OnKeywordSearchTermDeleted(this, url_id));
1123 } 1124 }
1124 1125
1125 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> 1126 scoped_ptr<base::CallbackList<void(const std::set<GURL>&,
1126 HistoryService::AddFaviconChangedCallback( 1127 const std::set<GURL>&)>::Subscription>
1127 const HistoryService::OnFaviconChangedCallback& callback) { 1128 HistoryService::AddFaviconsChangedCallback(
1129 const HistoryService::OnFaviconsChangedCallback& callback) {
1128 DCHECK(thread_checker_.CalledOnValidThread()); 1130 DCHECK(thread_checker_.CalledOnValidThread());
1129 return favicon_changed_callback_list_.Add(callback); 1131 return favicon_changed_callback_list_.Add(callback);
1130 } 1132 }
1131 1133
1132 void HistoryService::NotifyFaviconChanged( 1134 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls,
1133 const std::set<GURL>& changed_favicons) { 1135 const std::set<GURL>& icon_urls) {
1134 DCHECK(thread_checker_.CalledOnValidThread()); 1136 DCHECK(thread_checker_.CalledOnValidThread());
1135 favicon_changed_callback_list_.Notify(changed_favicons); 1137 favicon_changed_callback_list_.Notify(page_urls, icon_urls);
1136 } 1138 }
1137 1139
1138 } // namespace history 1140 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698