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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 HistoryService::Handle HistoryService::GetPageThumbnail( | 486 HistoryService::Handle HistoryService::GetPageThumbnail( |
487 const GURL& page_url, | 487 const GURL& page_url, |
488 CancelableRequestConsumerBase* consumer, | 488 CancelableRequestConsumerBase* consumer, |
489 const ThumbnailDataCallback& callback) { | 489 const ThumbnailDataCallback& callback) { |
490 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer, | 490 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer, |
491 new history::GetPageThumbnailRequest(callback), page_url); | 491 new history::GetPageThumbnailRequest(callback), page_url); |
492 } | 492 } |
493 | 493 |
494 void HistoryService::GetFavicon(FaviconService::GetFaviconRequest* request, | 494 void HistoryService::GetFavicon(FaviconService::GetFaviconRequest* request, |
495 const GURL& icon_url, | 495 const GURL& icon_url, |
| 496 const gfx::Size& pixel_size, |
496 history::IconType icon_type) { | 497 history::IconType icon_type) { |
497 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavicon, NULL, request, | 498 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavicon, NULL, request, |
498 icon_url, icon_type); | 499 icon_url, pixel_size, icon_type); |
499 } | 500 } |
500 | 501 |
501 void HistoryService::UpdateFaviconMappingAndFetch( | 502 void HistoryService::UpdateFaviconMappingAndFetch( |
502 FaviconService::GetFaviconRequest* request, | 503 FaviconService::GetFaviconRequest* request, |
503 const GURL& page_url, | 504 const GURL& page_url, |
504 const GURL& icon_url, | 505 const GURL& icon_url, |
| 506 const gfx::Size& pixel_size, |
505 history::IconType icon_type) { | 507 history::IconType icon_type) { |
506 Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateFaviconMappingAndFetch, NULL, | 508 Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateFaviconMappingAndFetch, NULL, |
507 request, page_url, icon_url, history::FAVICON); | 509 request, page_url, icon_url, pixel_size, history::FAVICON); |
508 } | 510 } |
509 | 511 |
510 void HistoryService::GetFaviconForURL( | 512 void HistoryService::GetFaviconForURL( |
511 FaviconService::GetFaviconRequest* request, | 513 FaviconService::GetFaviconRequest* request, |
512 const GURL& page_url, | 514 const GURL& page_url, |
| 515 const gfx::Size& pixel_size, |
513 int icon_types) { | 516 int icon_types) { |
514 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForURL, NULL, request, | 517 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForURL, NULL, request, |
515 page_url, icon_types); | 518 page_url, pixel_size, icon_types); |
516 } | 519 } |
517 | 520 |
518 void HistoryService::GetFaviconForID(FaviconService::GetFaviconRequest* request, | 521 void HistoryService::GetFaviconForID(FaviconService::GetFaviconRequest* request, |
519 history::FaviconID id) { | 522 history::FaviconID id) { |
520 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForID, NULL, request, | 523 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForID, NULL, request, |
521 id); | 524 id); |
522 } | 525 } |
523 | 526 |
524 void HistoryService::SetFavicon(const GURL& page_url, | 527 void HistoryService::SetFavicon(const GURL& page_url, |
525 const GURL& icon_url, | 528 const GURL& icon_url, |
526 const std::vector<unsigned char>& image_data, | 529 const std::vector<unsigned char>& image_data, |
| 530 const gfx::Size& requested_size, |
527 history::IconType icon_type) { | 531 history::IconType icon_type) { |
528 if (!CanAddURL(page_url)) | 532 if (!CanAddURL(page_url)) |
529 return; | 533 return; |
530 | 534 |
531 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, | 535 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, |
532 page_url, icon_url, | 536 page_url, icon_url, |
533 scoped_refptr<base::RefCountedMemory>( | 537 scoped_refptr<base::RefCountedMemory>( |
534 new base::RefCountedBytes(image_data)), | 538 new base::RefCountedBytes(image_data)), |
535 icon_type); | 539 requested_size, icon_type); |
536 } | 540 } |
537 | 541 |
538 void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) { | 542 void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) { |
539 ScheduleAndForget(PRIORITY_NORMAL, | 543 ScheduleAndForget(PRIORITY_NORMAL, |
540 &HistoryBackend::SetFaviconOutOfDateForPage, page_url); | 544 &HistoryBackend::SetFaviconOutOfDateForPage, page_url); |
541 } | 545 } |
542 | 546 |
543 void HistoryService::CloneFavicon(const GURL& old_page_url, | 547 void HistoryService::CloneFavicon(const GURL& old_page_url, |
544 const GURL& new_page_url) { | 548 const GURL& new_page_url) { |
545 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CloneFavicon, | 549 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CloneFavicon, |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 void HistoryService::RemoveVisitDatabaseObserver( | 943 void HistoryService::RemoveVisitDatabaseObserver( |
940 history::VisitDatabaseObserver* observer) { | 944 history::VisitDatabaseObserver* observer) { |
941 visit_database_observers_->RemoveObserver(observer); | 945 visit_database_observers_->RemoveObserver(observer); |
942 } | 946 } |
943 | 947 |
944 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 948 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
945 const history::BriefVisitInfo& info) { | 949 const history::BriefVisitInfo& info) { |
946 visit_database_observers_->Notify( | 950 visit_database_observers_->Notify( |
947 &history::VisitDatabaseObserver::OnAddVisit, info); | 951 &history::VisitDatabaseObserver::OnAddVisit, info); |
948 } | 952 } |
OLD | NEW |