| 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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 thread_->task_runner())); | 882 thread_->task_runner())); |
| 883 history_backend_.swap(backend); | 883 history_backend_.swap(backend); |
| 884 | 884 |
| 885 ScheduleTask(PRIORITY_UI, | 885 ScheduleTask(PRIORITY_UI, |
| 886 base::Bind(&HistoryBackend::Init, history_backend_.get(), | 886 base::Bind(&HistoryBackend::Init, history_backend_.get(), |
| 887 languages, no_db, history_database_params)); | 887 languages, no_db, history_database_params)); |
| 888 | 888 |
| 889 if (visit_delegate_ && !visit_delegate_->Init(this)) | 889 if (visit_delegate_ && !visit_delegate_->Init(this)) |
| 890 return false; | 890 return false; |
| 891 | 891 |
| 892 if (history_client_) |
| 893 history_client_->OnHistoryServiceCreated(this); |
| 894 |
| 892 return true; | 895 return true; |
| 893 } | 896 } |
| 894 | 897 |
| 895 void HistoryService::ScheduleAutocomplete( | 898 void HistoryService::ScheduleAutocomplete( |
| 896 const base::Callback<void(HistoryBackend*, URLDatabase*)>& callback) { | 899 const base::Callback<void(HistoryBackend*, URLDatabase*)>& callback) { |
| 897 DCHECK(thread_checker_.CalledOnValidThread()); | 900 DCHECK(thread_checker_.CalledOnValidThread()); |
| 898 ScheduleTask(PRIORITY_UI, base::Bind(&HistoryBackend::ScheduleAutocomplete, | 901 ScheduleTask(PRIORITY_UI, base::Bind(&HistoryBackend::ScheduleAutocomplete, |
| 899 history_backend_.get(), callback)); | 902 history_backend_.get(), callback)); |
| 900 } | 903 } |
| 901 | 904 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 return favicon_changed_callback_list_.Add(callback); | 1137 return favicon_changed_callback_list_.Add(callback); |
| 1135 } | 1138 } |
| 1136 | 1139 |
| 1137 void HistoryService::NotifyFaviconChanged( | 1140 void HistoryService::NotifyFaviconChanged( |
| 1138 const std::set<GURL>& changed_favicons) { | 1141 const std::set<GURL>& changed_favicons) { |
| 1139 DCHECK(thread_checker_.CalledOnValidThread()); | 1142 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1140 favicon_changed_callback_list_.Notify(changed_favicons); | 1143 favicon_changed_callback_list_.Notify(changed_favicons); |
| 1141 } | 1144 } |
| 1142 | 1145 |
| 1143 } // namespace history | 1146 } // namespace history |
| OLD | NEW |