| 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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 favicon_base::IconType icon_type, | 626 favicon_base::IconType icon_type, |
| 627 const GURL& icon_url, | 627 const GURL& icon_url, |
| 628 const std::vector<SkBitmap>& bitmaps, | 628 const std::vector<SkBitmap>& bitmaps, |
| 629 base::Callback<void(bool)> callback) { | 629 base::Callback<void(bool)> callback) { |
| 630 DCHECK(backend_task_runner_) << "History service being called after cleanup"; | 630 DCHECK(backend_task_runner_) << "History service being called after cleanup"; |
| 631 DCHECK(thread_checker_.CalledOnValidThread()); | 631 DCHECK(thread_checker_.CalledOnValidThread()); |
| 632 if (history_client_ && !history_client_->CanAddURL(page_url)) | 632 if (history_client_ && !history_client_->CanAddURL(page_url)) |
| 633 return; | 633 return; |
| 634 | 634 |
| 635 PostTaskAndReplyWithResult( | 635 PostTaskAndReplyWithResult( |
| 636 FROM_HERE, | 636 backend_task_runner_.get(), FROM_HERE, |
| 637 base::Bind(&HistoryBackend::SetLastResortFavicons, history_backend_, | 637 base::Bind(&HistoryBackend::SetLastResortFavicons, history_backend_, |
| 638 page_url, icon_type, icon_url, bitmaps), | 638 page_url, icon_type, icon_url, bitmaps), |
| 639 callback); | 639 callback); |
| 640 } | 640 } |
| 641 | 641 |
| 642 void HistoryService::SetFaviconsOutOfDateForPage(const GURL& page_url) { | 642 void HistoryService::SetFaviconsOutOfDateForPage(const GURL& page_url) { |
| 643 DCHECK(backend_task_runner_) << "History service being called after cleanup"; | 643 DCHECK(backend_task_runner_) << "History service being called after cleanup"; |
| 644 DCHECK(thread_checker_.CalledOnValidThread()); | 644 DCHECK(thread_checker_.CalledOnValidThread()); |
| 645 ScheduleTask(PRIORITY_NORMAL, | 645 ScheduleTask(PRIORITY_NORMAL, |
| 646 base::Bind(&HistoryBackend::SetFaviconsOutOfDateForPage, | 646 base::Bind(&HistoryBackend::SetFaviconsOutOfDateForPage, |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 return favicon_changed_callback_list_.Add(callback); | 1163 return favicon_changed_callback_list_.Add(callback); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 1166 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
| 1167 const GURL& icon_url) { | 1167 const GURL& icon_url) { |
| 1168 DCHECK(thread_checker_.CalledOnValidThread()); | 1168 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1169 favicon_changed_callback_list_.Notify(page_urls, icon_url); | 1169 favicon_changed_callback_list_.Notify(page_urls, icon_url); |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 } // namespace history | 1172 } // namespace history |
| OLD | NEW |