| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 } | 508 } |
| 509 | 509 |
| 510 void HistoryService::GetFaviconForURL( | 510 void HistoryService::GetFaviconForURL( |
| 511 FaviconService::GetFaviconRequest* request, | 511 FaviconService::GetFaviconRequest* request, |
| 512 const GURL& page_url, | 512 const GURL& page_url, |
| 513 int icon_types) { | 513 int icon_types) { |
| 514 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForURL, NULL, request, | 514 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForURL, NULL, request, |
| 515 page_url, icon_types); | 515 page_url, icon_types); |
| 516 } | 516 } |
| 517 | 517 |
| 518 void HistoryService::GetFaviconForID(FaviconService::GetFaviconRequest* request, | |
| 519 history::FaviconID id) { | |
| 520 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForID, NULL, request, | |
| 521 id); | |
| 522 } | |
| 523 | |
| 524 void HistoryService::SetFavicon(const GURL& page_url, | 518 void HistoryService::SetFavicon(const GURL& page_url, |
| 525 const GURL& icon_url, | 519 const GURL& icon_url, |
| 526 const std::vector<unsigned char>& image_data, | 520 const std::vector<unsigned char>& image_data, |
| 527 history::IconType icon_type) { | 521 history::IconType icon_type) { |
| 528 if (!CanAddURL(page_url)) | 522 if (!CanAddURL(page_url)) |
| 529 return; | 523 return; |
| 530 | 524 |
| 531 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, | 525 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, |
| 532 page_url, icon_url, | 526 page_url, icon_url, |
| 533 scoped_refptr<base::RefCountedMemory>( | 527 scoped_refptr<base::RefCountedMemory>( |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 void HistoryService::RemoveVisitDatabaseObserver( | 933 void HistoryService::RemoveVisitDatabaseObserver( |
| 940 history::VisitDatabaseObserver* observer) { | 934 history::VisitDatabaseObserver* observer) { |
| 941 visit_database_observers_->RemoveObserver(observer); | 935 visit_database_observers_->RemoveObserver(observer); |
| 942 } | 936 } |
| 943 | 937 |
| 944 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 938 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
| 945 const history::BriefVisitInfo& info) { | 939 const history::BriefVisitInfo& info) { |
| 946 visit_database_observers_->Notify( | 940 visit_database_observers_->Notify( |
| 947 &history::VisitDatabaseObserver::OnAddVisit, info); | 941 &history::VisitDatabaseObserver::OnAddVisit, info); |
| 948 } | 942 } |
| OLD | NEW |