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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 return false; | 956 return false; |
957 } | 957 } |
958 | 958 |
959 history_dir_ = history_database_params.history_dir; | 959 history_dir_ = history_database_params.history_dir; |
960 no_db_ = no_db; | 960 no_db_ = no_db; |
961 | 961 |
962 if (profile_) { | 962 if (profile_) { |
963 std::string languages = | 963 std::string languages = |
964 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); | 964 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); |
965 in_memory_url_index_.reset(new history::InMemoryURLIndex( | 965 in_memory_url_index_.reset(new history::InMemoryURLIndex( |
966 profile_, this, history_dir_, languages, history_client_)); | 966 this, history_dir_, languages, history_client_)); |
967 in_memory_url_index_->Init(); | 967 in_memory_url_index_->Init(); |
968 } | 968 } |
969 | 969 |
970 // Create the history backend. | 970 // Create the history backend. |
971 scoped_refptr<HistoryBackend> backend(new HistoryBackend( | 971 scoped_refptr<HistoryBackend> backend(new HistoryBackend( |
972 history_dir_, new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), | 972 history_dir_, new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), |
973 base::ThreadTaskRunnerHandle::Get()), | 973 base::ThreadTaskRunnerHandle::Get()), |
974 history_client_)); | 974 history_client_)); |
975 history_backend_.swap(backend); | 975 history_backend_.swap(backend); |
976 | 976 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 const HistoryService::OnFaviconChangedCallback& callback) { | 1268 const HistoryService::OnFaviconChangedCallback& callback) { |
1269 DCHECK(thread_checker_.CalledOnValidThread()); | 1269 DCHECK(thread_checker_.CalledOnValidThread()); |
1270 return favicon_changed_callback_list_.Add(callback); | 1270 return favicon_changed_callback_list_.Add(callback); |
1271 } | 1271 } |
1272 | 1272 |
1273 void HistoryService::NotifyFaviconChanged( | 1273 void HistoryService::NotifyFaviconChanged( |
1274 const std::set<GURL>& changed_favicons) { | 1274 const std::set<GURL>& changed_favicons) { |
1275 DCHECK(thread_checker_.CalledOnValidThread()); | 1275 DCHECK(thread_checker_.CalledOnValidThread()); |
1276 favicon_changed_callback_list_.Notify(changed_favicons); | 1276 favicon_changed_callback_list_.Notify(changed_favicons); |
1277 } | 1277 } |
OLD | NEW |