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 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 const GURL& icon_url, | 318 const GURL& icon_url, |
319 favicon_base::IconType icon_type, | 319 favicon_base::IconType icon_type, |
320 scoped_refptr<base::RefCountedMemory> bitmap_data, | 320 scoped_refptr<base::RefCountedMemory> bitmap_data, |
321 const gfx::Size& pixel_size); | 321 const gfx::Size& pixel_size); |
322 | 322 |
323 void SetFavicons(const GURL& page_url, | 323 void SetFavicons(const GURL& page_url, |
324 favicon_base::IconType icon_type, | 324 favicon_base::IconType icon_type, |
325 const GURL& icon_url, | 325 const GURL& icon_url, |
326 const std::vector<SkBitmap>& bitmaps); | 326 const std::vector<SkBitmap>& bitmaps); |
327 | 327 |
| 328 bool SetExpiredFaviconsIfNoneKnown(const GURL& page_url, |
| 329 favicon_base::IconType icon_type, |
| 330 const GURL& icon_url, |
| 331 const std::vector<SkBitmap>& bitmaps); |
| 332 |
328 void SetFaviconsOutOfDateForPage(const GURL& page_url); | 333 void SetFaviconsOutOfDateForPage(const GURL& page_url); |
329 | 334 |
330 void SetImportedFavicons( | 335 void SetImportedFavicons( |
331 const favicon_base::FaviconUsageDataList& favicon_usage); | 336 const favicon_base::FaviconUsageDataList& favicon_usage); |
332 | 337 |
333 // Downloads ----------------------------------------------------------------- | 338 // Downloads ----------------------------------------------------------------- |
334 | 339 |
335 uint32_t GetNextDownloadId(); | 340 uint32_t GetNextDownloadId(); |
336 void QueryDownloads(std::vector<DownloadRow>* rows); | 341 void QueryDownloads(std::vector<DownloadRow>* rows); |
337 void UpdateDownload(const DownloadRow& data, bool should_commit_immediately); | 342 void UpdateDownload(const DownloadRow& data, bool should_commit_immediately); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 SetFaviconMappingsForPageAndRedirects); | 513 SetFaviconMappingsForPageAndRedirects); |
509 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 514 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
510 SetFaviconMappingsForPageAndRedirectsWithFragment); | 515 SetFaviconMappingsForPageAndRedirectsWithFragment); |
511 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 516 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
512 SetFaviconMappingsForPageDuplicates); | 517 SetFaviconMappingsForPageDuplicates); |
513 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsDeleteBitmaps); | 518 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsDeleteBitmaps); |
514 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsReplaceBitmapData); | 519 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsReplaceBitmapData); |
515 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 520 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
516 SetFaviconsSameFaviconURLForTwoPages); | 521 SetFaviconsSameFaviconURLForTwoPages); |
517 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 522 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
| 523 SetExpiredFaviconsIfNoneKnownForEmptyDB); |
| 524 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
| 525 SetExpiredFaviconsIfNoneKnownForPageInDB); |
| 526 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
| 527 SetExpiredFaviconsIfNoneKnownForIconInDB); |
| 528 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
518 UpdateFaviconMappingsAndFetchNoChange); | 529 UpdateFaviconMappingsAndFetchNoChange); |
519 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLNotInDB); | 530 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLNotInDB); |
520 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLInDB); | 531 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLInDB); |
521 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconMaxFaviconsPerPage); | 532 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconMaxFaviconsPerPage); |
522 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 533 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
523 MergeFaviconIconURLMappedToDifferentPageURL); | 534 MergeFaviconIconURLMappedToDifferentPageURL); |
524 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 535 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
525 MergeFaviconMaxFaviconBitmapsPerIconURL); | 536 MergeFaviconMaxFaviconBitmapsPerIconURL); |
526 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 537 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
527 MergeIdenticalFaviconDoesNotChangeLastUpdatedTime); | 538 MergeIdenticalFaviconDoesNotChangeLastUpdatedTime); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 // Update the segment information. This is called internally when a page is | 660 // Update the segment information. This is called internally when a page is |
650 // added. Return the segment id of the segment that has been updated. | 661 // added. Return the segment id of the segment that has been updated. |
651 SegmentID UpdateSegments(const GURL& url, | 662 SegmentID UpdateSegments(const GURL& url, |
652 VisitID from_visit, | 663 VisitID from_visit, |
653 VisitID visit_id, | 664 VisitID visit_id, |
654 ui::PageTransition transition_type, | 665 ui::PageTransition transition_type, |
655 const base::Time ts); | 666 const base::Time ts); |
656 | 667 |
657 // Favicons ------------------------------------------------------------------ | 668 // Favicons ------------------------------------------------------------------ |
658 | 669 |
| 670 // If |bitmaps_are_expired| is true, the icon for |icon_url| will be modified |
| 671 // only if it's not present in the database. In that case, it will be |
| 672 // initially set as expired. Returns whether the new bitmaps were actually |
| 673 // written. |
| 674 bool SetFaviconsImpl(const GURL& page_url, |
| 675 favicon_base::IconType icon_type, |
| 676 const GURL& icon_url, |
| 677 const std::vector<SkBitmap>& bitmaps, |
| 678 bool bitmaps_are_expired); |
| 679 |
659 // Used by both UpdateFaviconMappingsAndFetch and GetFavicons. | 680 // Used by both UpdateFaviconMappingsAndFetch and GetFavicons. |
660 // If |page_url| is non-null, the icon urls for |page_url| (and all | 681 // If |page_url| is non-null, the icon urls for |page_url| (and all |
661 // redirects) are set to the subset of |icon_urls| for which icons are | 682 // redirects) are set to the subset of |icon_urls| for which icons are |
662 // already stored in the database. | 683 // already stored in the database. |
663 // If |page_url| is non-null, |icon_types| can be multiple icon types | 684 // If |page_url| is non-null, |icon_types| can be multiple icon types |
664 // only if |icon_types| == TOUCH_ICON | TOUCH_PRECOMPOSED_ICON. | 685 // only if |icon_types| == TOUCH_ICON | TOUCH_PRECOMPOSED_ICON. |
665 // If multiple icon types are specified, |page_url| will be mapped to the | 686 // If multiple icon types are specified, |page_url| will be mapped to the |
666 // icon URLs of the largest type available in the database. | 687 // icon URLs of the largest type available in the database. |
667 void UpdateFaviconMappingsAndFetchImpl( | 688 void UpdateFaviconMappingsAndFetchImpl( |
668 const GURL* page_url, | 689 const GURL* page_url, |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 // Init is called. Defined after observers_ because it unregisters itself as | 911 // Init is called. Defined after observers_ because it unregisters itself as |
891 // observer during destruction. | 912 // observer during destruction. |
892 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_; | 913 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
893 | 914 |
894 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 915 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
895 }; | 916 }; |
896 | 917 |
897 } // namespace history | 918 } // namespace history |
898 | 919 |
899 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 920 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
OLD | NEW |