| 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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 613 |
| 614 void HistoryService::SetFavicons(const GURL& page_url, | 614 void HistoryService::SetFavicons(const GURL& page_url, |
| 615 favicon_base::IconType icon_type, | 615 favicon_base::IconType icon_type, |
| 616 const GURL& icon_url, | 616 const GURL& icon_url, |
| 617 const std::vector<SkBitmap>& bitmaps) { | 617 const std::vector<SkBitmap>& bitmaps) { |
| 618 DCHECK(backend_task_runner_) << "History service being called after cleanup"; | 618 DCHECK(backend_task_runner_) << "History service being called after cleanup"; |
| 619 DCHECK(thread_checker_.CalledOnValidThread()); | 619 DCHECK(thread_checker_.CalledOnValidThread()); |
| 620 if (history_client_ && !history_client_->CanAddURL(page_url)) | 620 if (history_client_ && !history_client_->CanAddURL(page_url)) |
| 621 return; | 621 return; |
| 622 | 622 |
| 623 ScheduleTask(PRIORITY_NORMAL, | 623 ScheduleTask( |
| 624 base::Bind(&HistoryBackend::SetFavicons, history_backend_, | 624 PRIORITY_NORMAL, |
| 625 page_url, icon_type, icon_url, bitmaps)); | 625 base::Bind(base::IgnoreResult(&HistoryBackend::SetFavicons), |
| 626 history_backend_, page_url, icon_type, icon_url, bitmaps)); |
| 627 } |
| 628 |
| 629 void HistoryService::SetExpiredFaviconsIfNoneKnown( |
| 630 const GURL& page_url, |
| 631 favicon_base::IconType icon_type, |
| 632 const GURL& icon_url, |
| 633 const std::vector<SkBitmap>& bitmaps) { |
| 634 DCHECK(backend_task_runner_) << "History service being called after cleanup"; |
| 635 DCHECK(thread_checker_.CalledOnValidThread()); |
| 636 if (history_client_ && !history_client_->CanAddURL(page_url)) |
| 637 return; |
| 638 |
| 639 ScheduleTask( |
| 640 PRIORITY_NORMAL, |
| 641 base::Bind(&HistoryBackend::SetExpiredFaviconsIfNoneKnown, |
| 642 history_backend_, page_url, icon_type, icon_url, bitmaps)); |
| 626 } | 643 } |
| 627 | 644 |
| 628 void HistoryService::SetFaviconsOutOfDateForPage(const GURL& page_url) { | 645 void HistoryService::SetFaviconsOutOfDateForPage(const GURL& page_url) { |
| 629 DCHECK(backend_task_runner_) << "History service being called after cleanup"; | 646 DCHECK(backend_task_runner_) << "History service being called after cleanup"; |
| 630 DCHECK(thread_checker_.CalledOnValidThread()); | 647 DCHECK(thread_checker_.CalledOnValidThread()); |
| 631 ScheduleTask(PRIORITY_NORMAL, | 648 ScheduleTask(PRIORITY_NORMAL, |
| 632 base::Bind(&HistoryBackend::SetFaviconsOutOfDateForPage, | 649 base::Bind(&HistoryBackend::SetFaviconsOutOfDateForPage, |
| 633 history_backend_, page_url)); | 650 history_backend_, page_url)); |
| 634 } | 651 } |
| 635 | 652 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 return favicon_changed_callback_list_.Add(callback); | 1166 return favicon_changed_callback_list_.Add(callback); |
| 1150 } | 1167 } |
| 1151 | 1168 |
| 1152 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 1169 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
| 1153 const GURL& icon_url) { | 1170 const GURL& icon_url) { |
| 1154 DCHECK(thread_checker_.CalledOnValidThread()); | 1171 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1155 favicon_changed_callback_list_.Notify(page_urls, icon_url); | 1172 favicon_changed_callback_list_.Notify(page_urls, icon_url); |
| 1156 } | 1173 } |
| 1157 | 1174 |
| 1158 } // namespace history | 1175 } // namespace history |
| OLD | NEW |