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