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

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::vector<GURL>& page_urls,
122 const std::vector<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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_, 1106 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_,
1106 OnKeywordSearchTermUpdated(this, row, keyword_id, term)); 1107 OnKeywordSearchTermUpdated(this, row, keyword_id, term));
1107 } 1108 }
1108 1109
1109 void HistoryService::NotifyKeywordSearchTermDeleted(URLID url_id) { 1110 void HistoryService::NotifyKeywordSearchTermDeleted(URLID url_id) {
1110 DCHECK(thread_checker_.CalledOnValidThread()); 1111 DCHECK(thread_checker_.CalledOnValidThread());
1111 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_, 1112 FOR_EACH_OBSERVER(HistoryServiceObserver, observers_,
1112 OnKeywordSearchTermDeleted(this, url_id)); 1113 OnKeywordSearchTermDeleted(this, url_id));
1113 } 1114 }
1114 1115
1115 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> 1116 scoped_ptr<base::CallbackList<void(const std::vector<GURL>&,
1116 HistoryService::AddFaviconChangedCallback( 1117 const std::vector<GURL>&)>::Subscription>
1117 const HistoryService::OnFaviconChangedCallback& callback) { 1118 HistoryService::AddFaviconsChangedCallback(
1119 const HistoryService::OnFaviconsChangedCallback& callback) {
1118 DCHECK(thread_checker_.CalledOnValidThread()); 1120 DCHECK(thread_checker_.CalledOnValidThread());
1119 return favicon_changed_callback_list_.Add(callback); 1121 return favicon_changed_callback_list_.Add(callback);
1120 } 1122 }
1121 1123
1122 void HistoryService::NotifyFaviconChanged( 1124 void HistoryService::NotifyFaviconsChanged(const std::vector<GURL>& page_urls,
1123 const std::set<GURL>& changed_favicons) { 1125 const std::vector<GURL>& icon_urls) {
1124 DCHECK(thread_checker_.CalledOnValidThread()); 1126 DCHECK(thread_checker_.CalledOnValidThread());
1125 favicon_changed_callback_list_.Notify(changed_favicons); 1127 favicon_changed_callback_list_.Notify(page_urls, icon_urls);
1126 } 1128 }
1127 1129
1128 } // namespace history 1130 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698