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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 | 503 |
504 void HistoryService::SetFavicon(const GURL& page_url, | 504 void HistoryService::SetFavicon(const GURL& page_url, |
505 const GURL& icon_url, | 505 const GURL& icon_url, |
506 const std::vector<unsigned char>& image_data, | 506 const std::vector<unsigned char>& image_data, |
507 history::IconType icon_type) { | 507 history::IconType icon_type) { |
508 if (!CanAddURL(page_url)) | 508 if (!CanAddURL(page_url)) |
509 return; | 509 return; |
510 | 510 |
511 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, | 511 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, |
512 page_url, icon_url, | 512 page_url, icon_url, |
513 scoped_refptr<RefCountedMemory>(new base::RefCountedBytes(image_data)), | 513 scoped_refptr<base::RefCountedMemory>( |
| 514 new base::RefCountedBytes(image_data)), |
514 icon_type); | 515 icon_type); |
515 } | 516 } |
516 | 517 |
517 void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) { | 518 void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) { |
518 ScheduleAndForget(PRIORITY_NORMAL, | 519 ScheduleAndForget(PRIORITY_NORMAL, |
519 &HistoryBackend::SetFaviconOutOfDateForPage, page_url); | 520 &HistoryBackend::SetFaviconOutOfDateForPage, page_url); |
520 } | 521 } |
521 | 522 |
522 void HistoryService::CloneFavicon(const GURL& old_page_url, | 523 void HistoryService::CloneFavicon(const GURL& old_page_url, |
523 const GURL& new_page_url) { | 524 const GURL& new_page_url) { |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 void HistoryService::RemoveVisitDatabaseObserver( | 914 void HistoryService::RemoveVisitDatabaseObserver( |
914 history::VisitDatabaseObserver* observer) { | 915 history::VisitDatabaseObserver* observer) { |
915 visit_database_observers_->RemoveObserver(observer); | 916 visit_database_observers_->RemoveObserver(observer); |
916 } | 917 } |
917 | 918 |
918 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 919 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
919 const history::BriefVisitInfo& info) { | 920 const history::BriefVisitInfo& info) { |
920 visit_database_observers_->Notify( | 921 visit_database_observers_->Notify( |
921 &history::VisitDatabaseObserver::OnAddVisit, info); | 922 &history::VisitDatabaseObserver::OnAddVisit, info); |
922 } | 923 } |
OLD | NEW |