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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 protected: | 449 protected: |
450 ~HistoryBackend() override; | 450 ~HistoryBackend() override; |
451 | 451 |
452 private: | 452 private: |
453 friend class base::RefCountedThreadSafe<HistoryBackend>; | 453 friend class base::RefCountedThreadSafe<HistoryBackend>; |
454 friend class CommitLaterTask; // The commit task needs to call Commit(). | 454 friend class CommitLaterTask; // The commit task needs to call Commit(). |
455 friend class HistoryBackendTest; | 455 friend class HistoryBackendTest; |
456 friend class HistoryBackendDBBaseTest; // So the unit tests can poke our | 456 friend class HistoryBackendDBBaseTest; // So the unit tests can poke our |
457 // innards. | 457 // innards. |
458 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll); | 458 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll); |
| 459 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAllURLPreviouslyDeleted); |
459 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAllThenAddData); | 460 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAllThenAddData); |
460 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPagesWithDetails); | 461 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPagesWithDetails); |
461 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, UpdateURLs); | 462 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, UpdateURLs); |
462 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, ImportedFaviconsTest); | 463 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, ImportedFaviconsTest); |
463 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, URLsNoLongerBookmarked); | 464 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, URLsNoLongerBookmarked); |
464 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, StripUsernamePasswordTest); | 465 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, StripUsernamePasswordTest); |
465 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteThumbnailsDatabaseTest); | 466 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteThumbnailsDatabaseTest); |
466 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPageVisitSource); | 467 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPageVisitSource); |
467 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPageVisitBackForward); | 468 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPageVisitBackForward); |
468 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPageVisitRedirectBackForward); | 469 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddPageVisitRedirectBackForward); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 // from our normal dependency-following method for performance reasons. The | 722 // from our normal dependency-following method for performance reasons. The |
722 // logic lives here instead of ExpireHistoryBackend since it will cause | 723 // logic lives here instead of ExpireHistoryBackend since it will cause |
723 // re-initialization of some databases (e.g. Thumbnails) that could fail. | 724 // re-initialization of some databases (e.g. Thumbnails) that could fail. |
724 // When these databases are not valid, our pointers must be null, so we need | 725 // When these databases are not valid, our pointers must be null, so we need |
725 // to handle this type of operation to keep the pointers in sync. | 726 // to handle this type of operation to keep the pointers in sync. |
726 void DeleteAllHistory(); | 727 void DeleteAllHistory(); |
727 | 728 |
728 // Given a vector of all URLs that we will keep, removes all thumbnails | 729 // Given a vector of all URLs that we will keep, removes all thumbnails |
729 // referenced by any URL, and also all favicons that aren't used by those | 730 // referenced by any URL, and also all favicons that aren't used by those |
730 // URLs. | 731 // URLs. |
731 bool ClearAllThumbnailHistory(const URLRows& kept_urls); | 732 bool ClearAllThumbnailHistory(const std::vector<GURL>& kept_urls); |
732 | 733 |
733 // Deletes all information in the history database, except for the supplied | 734 // Deletes all information in the history database, except for the supplied |
734 // set of URLs in the URL table (these should correspond to the bookmarked | 735 // set of URLs in the URL table (these should correspond to the bookmarked |
735 // URLs). | 736 // URLs). |
736 // | 737 // |
737 // The IDs of the URLs may change. | 738 // The IDs of the URLs may change. |
738 bool ClearAllMainHistory(const URLRows& kept_urls); | 739 bool ClearAllMainHistory(const URLRows& kept_urls); |
739 | 740 |
740 // Deletes the FTS index database files, which are no longer used. | 741 // Deletes the FTS index database files, which are no longer used. |
741 void DeleteFTSIndexDatabases(); | 742 void DeleteFTSIndexDatabases(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 | 823 |
823 // List of observers | 824 // List of observers |
824 ObserverList<HistoryBackendObserver> observers_; | 825 ObserverList<HistoryBackendObserver> observers_; |
825 | 826 |
826 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 827 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
827 }; | 828 }; |
828 | 829 |
829 } // namespace history | 830 } // namespace history |
830 | 831 |
831 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 832 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
OLD | NEW |