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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 Cleanup(); | 968 Cleanup(); |
969 return false; | 969 return false; |
970 } | 970 } |
971 | 971 |
972 history_dir_ = history_database_params.history_dir; | 972 history_dir_ = history_database_params.history_dir; |
973 no_db_ = no_db; | 973 no_db_ = no_db; |
974 | 974 |
975 if (!languages.empty()) { | 975 if (!languages.empty()) { |
976 // Do not create |in_memory_url_index_| when languages is empty (which | 976 // Do not create |in_memory_url_index_| when languages is empty (which |
977 // should only happens during testing). | 977 // should only happens during testing). |
978 in_memory_url_index_.reset(new history::InMemoryURLIndex( | 978 in_memory_url_index_.reset( |
979 this, history_dir_, languages, history_client_)); | 979 new history::InMemoryURLIndex(this, history_dir_, languages)); |
980 in_memory_url_index_->Init(); | 980 in_memory_url_index_->Init(); |
981 } | 981 } |
982 | 982 |
983 // Create the history backend. | 983 // Create the history backend. |
984 scoped_refptr<HistoryBackend> backend(new HistoryBackend( | 984 scoped_refptr<HistoryBackend> backend(new HistoryBackend( |
985 history_dir_, new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), | 985 history_dir_, new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), |
986 base::ThreadTaskRunnerHandle::Get()), | 986 base::ThreadTaskRunnerHandle::Get()), |
987 history_client_)); | 987 history_client_)); |
988 history_backend_.swap(backend); | 988 history_backend_.swap(backend); |
989 | 989 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 const HistoryService::OnFaviconChangedCallback& callback) { | 1275 const HistoryService::OnFaviconChangedCallback& callback) { |
1276 DCHECK(thread_checker_.CalledOnValidThread()); | 1276 DCHECK(thread_checker_.CalledOnValidThread()); |
1277 return favicon_changed_callback_list_.Add(callback); | 1277 return favicon_changed_callback_list_.Add(callback); |
1278 } | 1278 } |
1279 | 1279 |
1280 void HistoryService::NotifyFaviconChanged( | 1280 void HistoryService::NotifyFaviconChanged( |
1281 const std::set<GURL>& changed_favicons) { | 1281 const std::set<GURL>& changed_favicons) { |
1282 DCHECK(thread_checker_.CalledOnValidThread()); | 1282 DCHECK(thread_checker_.CalledOnValidThread()); |
1283 favicon_changed_callback_list_.Notify(changed_favicons); | 1283 favicon_changed_callback_list_.Notify(changed_favicons); |
1284 } | 1284 } |
OLD | NEW |