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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 } | 421 } |
422 | 422 |
423 void HistoryService::SetPageTitle(const GURL& url, | 423 void HistoryService::SetPageTitle(const GURL& url, |
424 const base::string16& title) { | 424 const base::string16& title) { |
425 DCHECK(thread_) << "History service being called after cleanup"; | 425 DCHECK(thread_) << "History service being called after cleanup"; |
426 DCHECK(thread_checker_.CalledOnValidThread()); | 426 DCHECK(thread_checker_.CalledOnValidThread()); |
427 ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::SetPageTitle, | 427 ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::SetPageTitle, |
428 history_backend_.get(), url, title)); | 428 history_backend_.get(), url, title)); |
429 } | 429 } |
430 | 430 |
| 431 void HistoryService::SetPageHistoryContext(const GURL& url, |
| 432 HistoryContext context) { |
| 433 DCHECK(thread_) << "History service being called after cleanup"; |
| 434 DCHECK(thread_checker_.CalledOnValidThread()); |
| 435 ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::SetPageHistoryContex
t, |
| 436 history_backend_.get(), url, context)
); |
| 437 } |
431 void HistoryService::UpdateWithPageEndTime(ContextID context_id, | 438 void HistoryService::UpdateWithPageEndTime(ContextID context_id, |
432 int nav_entry_id, | 439 int nav_entry_id, |
433 const GURL& url, | 440 const GURL& url, |
434 Time end_ts) { | 441 Time end_ts) { |
435 DCHECK(thread_) << "History service being called after cleanup"; | 442 DCHECK(thread_) << "History service being called after cleanup"; |
436 DCHECK(thread_checker_.CalledOnValidThread()); | 443 DCHECK(thread_checker_.CalledOnValidThread()); |
437 ScheduleTask( | 444 ScheduleTask( |
438 PRIORITY_NORMAL, | 445 PRIORITY_NORMAL, |
439 base::Bind(&HistoryBackend::UpdateWithPageEndTime, history_backend_.get(), | 446 base::Bind(&HistoryBackend::UpdateWithPageEndTime, history_backend_.get(), |
440 context_id, nav_entry_id, url, end_ts)); | 447 context_id, nav_entry_id, url, end_ts)); |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 return favicon_changed_callback_list_.Add(callback); | 1125 return favicon_changed_callback_list_.Add(callback); |
1119 } | 1126 } |
1120 | 1127 |
1121 void HistoryService::NotifyFaviconChanged( | 1128 void HistoryService::NotifyFaviconChanged( |
1122 const std::set<GURL>& changed_favicons) { | 1129 const std::set<GURL>& changed_favicons) { |
1123 DCHECK(thread_checker_.CalledOnValidThread()); | 1130 DCHECK(thread_checker_.CalledOnValidThread()); |
1124 favicon_changed_callback_list_.Notify(changed_favicons); | 1131 favicon_changed_callback_list_.Notify(changed_favicons); |
1125 } | 1132 } |
1126 | 1133 |
1127 } // namespace history | 1134 } // namespace history |
OLD | NEW |