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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 } | 912 } |
913 | 913 |
914 void HistoryService::ScheduleAutocomplete( | 914 void HistoryService::ScheduleAutocomplete( |
915 const base::Callback<void(HistoryBackend*, URLDatabase*)>& callback) { | 915 const base::Callback<void(HistoryBackend*, URLDatabase*)>& callback) { |
916 DCHECK(thread_checker_.CalledOnValidThread()); | 916 DCHECK(thread_checker_.CalledOnValidThread()); |
917 ScheduleTask(PRIORITY_UI, base::Bind(&HistoryBackend::ScheduleAutocomplete, | 917 ScheduleTask(PRIORITY_UI, base::Bind(&HistoryBackend::ScheduleAutocomplete, |
918 history_backend_, callback)); | 918 history_backend_, callback)); |
919 } | 919 } |
920 | 920 |
921 void HistoryService::ScheduleTask(SchedulePriority priority, | 921 void HistoryService::ScheduleTask(SchedulePriority priority, |
922 const base::Closure& task) { | 922 base::Closure task) { |
923 DCHECK(thread_checker_.CalledOnValidThread()); | 923 DCHECK(thread_checker_.CalledOnValidThread()); |
924 CHECK(backend_task_runner_); | 924 CHECK(backend_task_runner_); |
925 // TODO(brettw): Do prioritization. | 925 // TODO(brettw): Do prioritization. |
926 backend_task_runner_->PostTask(FROM_HERE, task); | 926 backend_task_runner_->PostTask(FROM_HERE, std::move(task)); |
927 } | 927 } |
928 | 928 |
929 base::WeakPtr<HistoryService> HistoryService::AsWeakPtr() { | 929 base::WeakPtr<HistoryService> HistoryService::AsWeakPtr() { |
930 DCHECK(thread_checker_.CalledOnValidThread()); | 930 DCHECK(thread_checker_.CalledOnValidThread()); |
931 return weak_ptr_factory_.GetWeakPtr(); | 931 return weak_ptr_factory_.GetWeakPtr(); |
932 } | 932 } |
933 | 933 |
934 syncer::SyncMergeResult HistoryService::MergeDataAndStartSyncing( | 934 syncer::SyncMergeResult HistoryService::MergeDataAndStartSyncing( |
935 syncer::ModelType type, | 935 syncer::ModelType type, |
936 const syncer::SyncDataList& initial_sync_data, | 936 const syncer::SyncDataList& initial_sync_data, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 return favicon_changed_callback_list_.Add(callback); | 1149 return favicon_changed_callback_list_.Add(callback); |
1150 } | 1150 } |
1151 | 1151 |
1152 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 1152 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
1153 const GURL& icon_url) { | 1153 const GURL& icon_url) { |
1154 DCHECK(thread_checker_.CalledOnValidThread()); | 1154 DCHECK(thread_checker_.CalledOnValidThread()); |
1155 favicon_changed_callback_list_.Notify(page_urls, icon_url); | 1155 favicon_changed_callback_list_.Notify(page_urls, icon_url); |
1156 } | 1156 } |
1157 | 1157 |
1158 } // namespace history | 1158 } // namespace history |
OLD | NEW |