| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 PRIORITY_NORMAL, | 353 PRIORITY_NORMAL, |
| 354 base::Bind(&HistoryBackend::SetOnBackendDestroyTask, | 354 base::Bind(&HistoryBackend::SetOnBackendDestroyTask, |
| 355 history_backend_.get(), base::MessageLoop::current(), task)); | 355 history_backend_.get(), base::MessageLoop::current(), task)); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void HistoryService::TopHosts(int num_hosts, | 358 void HistoryService::TopHosts(int num_hosts, |
| 359 const TopHostsCallback& callback) const { | 359 const TopHostsCallback& callback) const { |
| 360 DCHECK(thread_) << "History service being called after cleanup"; | 360 DCHECK(thread_) << "History service being called after cleanup"; |
| 361 DCHECK(thread_checker_.CalledOnValidThread()); | 361 DCHECK(thread_checker_.CalledOnValidThread()); |
| 362 PostTaskAndReplyWithResult( | 362 PostTaskAndReplyWithResult( |
| 363 thread_->message_loop_proxy().get(), FROM_HERE, | 363 thread_->task_runner().get(), FROM_HERE, |
| 364 base::Bind(&HistoryBackend::TopHosts, history_backend_.get(), num_hosts), | 364 base::Bind(&HistoryBackend::TopHosts, history_backend_.get(), num_hosts), |
| 365 callback); | 365 callback); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void HistoryService::AddPage(const GURL& url, | 368 void HistoryService::AddPage(const GURL& url, |
| 369 Time time, | 369 Time time, |
| 370 ContextID context_id, | 370 ContextID context_id, |
| 371 int nav_entry_id, | 371 int nav_entry_id, |
| 372 const GURL& referrer, | 372 const GURL& referrer, |
| 373 const RedirectList& redirects, | 373 const RedirectList& redirects, |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 return favicon_changed_callback_list_.Add(callback); | 1129 return favicon_changed_callback_list_.Add(callback); |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 void HistoryService::NotifyFaviconChanged( | 1132 void HistoryService::NotifyFaviconChanged( |
| 1133 const std::set<GURL>& changed_favicons) { | 1133 const std::set<GURL>& changed_favicons) { |
| 1134 DCHECK(thread_checker_.CalledOnValidThread()); | 1134 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1135 favicon_changed_callback_list_.Notify(changed_favicons); | 1135 favicon_changed_callback_list_.Notify(changed_favicons); |
| 1136 } | 1136 } |
| 1137 | 1137 |
| 1138 } // namespace history | 1138 } // namespace history |
| OLD | NEW |