| 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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 } | 930 } |
| 931 | 931 |
| 932 void HistoryService::ScheduleAutocomplete( | 932 void HistoryService::ScheduleAutocomplete( |
| 933 const base::Callback<void(HistoryBackend*, URLDatabase*)>& callback) { | 933 const base::Callback<void(HistoryBackend*, URLDatabase*)>& callback) { |
| 934 DCHECK(thread_checker_.CalledOnValidThread()); | 934 DCHECK(thread_checker_.CalledOnValidThread()); |
| 935 ScheduleTask(PRIORITY_UI, base::Bind(&HistoryBackend::ScheduleAutocomplete, | 935 ScheduleTask(PRIORITY_UI, base::Bind(&HistoryBackend::ScheduleAutocomplete, |
| 936 history_backend_, callback)); | 936 history_backend_, callback)); |
| 937 } | 937 } |
| 938 | 938 |
| 939 void HistoryService::ScheduleTask(SchedulePriority priority, | 939 void HistoryService::ScheduleTask(SchedulePriority priority, |
| 940 base::Closure task) { | 940 base::OnceClosure task) { |
| 941 DCHECK(thread_checker_.CalledOnValidThread()); | 941 DCHECK(thread_checker_.CalledOnValidThread()); |
| 942 CHECK(backend_task_runner_); | 942 CHECK(backend_task_runner_); |
| 943 // TODO(brettw): Do prioritization. | 943 // TODO(brettw): Do prioritization. |
| 944 backend_task_runner_->PostTask(FROM_HERE, std::move(task)); | 944 backend_task_runner_->PostTask(FROM_HERE, std::move(task)); |
| 945 } | 945 } |
| 946 | 946 |
| 947 base::WeakPtr<HistoryService> HistoryService::AsWeakPtr() { | 947 base::WeakPtr<HistoryService> HistoryService::AsWeakPtr() { |
| 948 DCHECK(thread_checker_.CalledOnValidThread()); | 948 DCHECK(thread_checker_.CalledOnValidThread()); |
| 949 return weak_ptr_factory_.GetWeakPtr(); | 949 return weak_ptr_factory_.GetWeakPtr(); |
| 950 } | 950 } |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 return favicon_changed_callback_list_.Add(callback); | 1167 return favicon_changed_callback_list_.Add(callback); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 1170 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
| 1171 const GURL& icon_url) { | 1171 const GURL& icon_url) { |
| 1172 DCHECK(thread_checker_.CalledOnValidThread()); | 1172 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1173 favicon_changed_callback_list_.Notify(page_urls, icon_url); | 1173 favicon_changed_callback_list_.Notify(page_urls, icon_url); |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 } // namespace history | 1176 } // namespace history |
| OLD | NEW |