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 base::Thread::Options options; | 930 base::Thread::Options options; |
931 options.timer_slack = base::TIMER_SLACK_MAXIMUM; | 931 options.timer_slack = base::TIMER_SLACK_MAXIMUM; |
932 if (!thread_->StartWithOptions(options)) { | 932 if (!thread_->StartWithOptions(options)) { |
933 Cleanup(); | 933 Cleanup(); |
934 return false; | 934 return false; |
935 } | 935 } |
936 | 936 |
937 if (!languages.empty()) { | 937 if (!languages.empty()) { |
938 // Do not create |in_memory_url_index_| when languages is empty (which | 938 // Do not create |in_memory_url_index_| when languages is empty (which |
939 // should only happens during testing). | 939 // should only happens during testing). |
940 in_memory_url_index_.reset(new history::InMemoryURLIndex( | 940 in_memory_url_index_.reset(new InMemoryURLIndex( |
941 this, history_database_params.history_dir, languages)); | 941 this, history_database_params.history_dir, languages)); |
942 in_memory_url_index_->Init(); | 942 in_memory_url_index_->Init(); |
943 } | 943 } |
944 | 944 |
945 // Create the history backend. | 945 // Create the history backend. |
946 scoped_refptr<HistoryBackend> backend(new HistoryBackend( | 946 scoped_refptr<HistoryBackend> backend(new HistoryBackend( |
947 new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), | 947 new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), |
948 base::ThreadTaskRunnerHandle::Get()), | 948 base::ThreadTaskRunnerHandle::Get()), |
949 history_client_)); | 949 history_client_)); |
950 history_backend_.swap(backend); | 950 history_backend_.swap(backend); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 const HistoryService::OnFaviconChangedCallback& callback) { | 1212 const HistoryService::OnFaviconChangedCallback& callback) { |
1213 DCHECK(thread_checker_.CalledOnValidThread()); | 1213 DCHECK(thread_checker_.CalledOnValidThread()); |
1214 return favicon_changed_callback_list_.Add(callback); | 1214 return favicon_changed_callback_list_.Add(callback); |
1215 } | 1215 } |
1216 | 1216 |
1217 void HistoryService::NotifyFaviconChanged( | 1217 void HistoryService::NotifyFaviconChanged( |
1218 const std::set<GURL>& changed_favicons) { | 1218 const std::set<GURL>& changed_favicons) { |
1219 DCHECK(thread_checker_.CalledOnValidThread()); | 1219 DCHECK(thread_checker_.CalledOnValidThread()); |
1220 favicon_changed_callback_list_.Notify(changed_favicons); | 1220 favicon_changed_callback_list_.Notify(changed_favicons); |
1221 } | 1221 } |
OLD | NEW |