| 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 CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class PageUsageRequest; | 46 class PageUsageRequest; |
| 47 class Profile; | 47 class Profile; |
| 48 struct ImportedFaviconUsage; | 48 struct ImportedFaviconUsage; |
| 49 class SkBitmap; | 49 class SkBitmap; |
| 50 | 50 |
| 51 namespace base { | 51 namespace base { |
| 52 class FilePath; | 52 class FilePath; |
| 53 class Thread; | 53 class Thread; |
| 54 } | 54 } |
| 55 | 55 |
| 56 namespace safe_browsing { |
| 57 class LastDownloadFinder; |
| 58 } |
| 59 |
| 56 namespace visitedlink { | 60 namespace visitedlink { |
| 57 class VisitedLinkMaster; | 61 class VisitedLinkMaster; |
| 58 } | 62 } |
| 59 | 63 |
| 60 namespace history { | 64 namespace history { |
| 61 | 65 |
| 62 class HistoryBackend; | 66 class HistoryBackend; |
| 63 class HistoryClient; | 67 class HistoryClient; |
| 64 class HistoryDatabase; | 68 class HistoryDatabase; |
| 65 class HistoryDBTask; | 69 class HistoryDBTask; |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 friend class FaviconService; | 536 friend class FaviconService; |
| 533 friend class history::HistoryBackend; | 537 friend class history::HistoryBackend; |
| 534 friend class history::HistoryQueryTest; | 538 friend class history::HistoryQueryTest; |
| 535 friend class HistoryOperation; | 539 friend class HistoryOperation; |
| 536 friend class HistoryQuickProviderTest; | 540 friend class HistoryQuickProviderTest; |
| 537 friend class history::HistoryTest; | 541 friend class history::HistoryTest; |
| 538 friend class HistoryURLProvider; | 542 friend class HistoryURLProvider; |
| 539 friend class HistoryURLProviderTest; | 543 friend class HistoryURLProviderTest; |
| 540 friend class history::InMemoryURLIndexTest; | 544 friend class history::InMemoryURLIndexTest; |
| 541 template<typename Info, typename Callback> friend class DownloadRequest; | 545 template<typename Info, typename Callback> friend class DownloadRequest; |
| 546 friend class safe_browsing::LastDownloadFinder; |
| 542 friend class PageUsageRequest; | 547 friend class PageUsageRequest; |
| 543 friend class RedirectRequest; | 548 friend class RedirectRequest; |
| 549 friend class SyncBookmarkDataTypeControllerTest; |
| 544 friend class TestingProfile; | 550 friend class TestingProfile; |
| 545 | 551 |
| 546 // Called on shutdown, this will tell the history backend to complete and | 552 // Called on shutdown, this will tell the history backend to complete and |
| 547 // will release pointers to it. No other functions should be called once | 553 // will release pointers to it. No other functions should be called once |
| 548 // cleanup has happened that may dispatch to the history thread (because it | 554 // cleanup has happened that may dispatch to the history thread (because it |
| 549 // will be NULL). | 555 // will be NULL). |
| 550 // | 556 // |
| 551 // In practice, this will be called by the service manager (BrowserProcess) | 557 // In practice, this will be called by the service manager (BrowserProcess) |
| 552 // when it is being destroyed. Because that reference is being destroyed, it | 558 // when it is being destroyed. Because that reference is being destroyed, it |
| 553 // should be impossible for anybody else to call the service, even if it is | 559 // should be impossible for anybody else to call the service, even if it is |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // |redirects| is an empty vector. | 606 // |redirects| is an empty vector. |
| 601 void NotifyURLVisited(ui::PageTransition transition, | 607 void NotifyURLVisited(ui::PageTransition transition, |
| 602 const history::URLRow& row, | 608 const history::URLRow& row, |
| 603 const history::RedirectList& redirects, | 609 const history::RedirectList& redirects, |
| 604 base::Time visit_time); | 610 base::Time visit_time); |
| 605 | 611 |
| 606 // Notify all HistoryServiceObservers registered that URLs have been added or | 612 // Notify all HistoryServiceObservers registered that URLs have been added or |
| 607 // modified. |changed_urls| contains the list of affects URLs. | 613 // modified. |changed_urls| contains the list of affects URLs. |
| 608 void NotifyURLsModified(const history::URLRows& changed_urls); | 614 void NotifyURLsModified(const history::URLRows& changed_urls); |
| 609 | 615 |
| 616 // Notify all HistoryServiceObservers registered that the |
| 617 // HistoryService has finished loading. |
| 618 void NotifyHistoryServiceLoaded(); |
| 619 |
| 620 // HistoryService is being deleted. |
| 621 void NotifyHistoryServiceBeingDeleted(); |
| 622 |
| 610 // Favicon ------------------------------------------------------------------- | 623 // Favicon ------------------------------------------------------------------- |
| 611 | 624 |
| 612 // These favicon methods are exposed to the FaviconService. Instead of calling | 625 // These favicon methods are exposed to the FaviconService. Instead of calling |
| 613 // these methods directly you should call the respective method on the | 626 // these methods directly you should call the respective method on the |
| 614 // FaviconService. | 627 // FaviconService. |
| 615 | 628 |
| 616 // Used by FaviconService to get the favicon bitmaps from the history backend | 629 // Used by FaviconService to get the favicon bitmaps from the history backend |
| 617 // whose edge sizes most closely match |desired_sizes| for |icon_types|. If | 630 // whose edge sizes most closely match |desired_sizes| for |icon_types|. If |
| 618 // |desired_sizes| has a '0' entry, the largest favicon bitmap for | 631 // |desired_sizes| has a '0' entry, the largest favicon bitmap for |
| 619 // |icon_types| is returned. The returned FaviconBitmapResults will have at | 632 // |icon_types| is returned. The returned FaviconBitmapResults will have at |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 const ArgB& b, | 851 const ArgB& b, |
| 839 const ArgC& c, | 852 const ArgC& c, |
| 840 const ArgD& d, | 853 const ArgD& d, |
| 841 const ArgE& e) { | 854 const ArgE& e) { |
| 842 DCHECK(thread_) << "History service being called after cleanup"; | 855 DCHECK(thread_) << "History service being called after cleanup"; |
| 843 DCHECK(thread_checker_.CalledOnValidThread()); | 856 DCHECK(thread_checker_.CalledOnValidThread()); |
| 844 ScheduleTask(priority, base::Bind(func, history_backend_.get(), | 857 ScheduleTask(priority, base::Bind(func, history_backend_.get(), |
| 845 a, b, c, d, e)); | 858 a, b, c, d, e)); |
| 846 } | 859 } |
| 847 | 860 |
| 861 // TODO(sdefresne): http://crbug.com/430070 remove this method. |
| 862 Profile* profile() { return profile_; } |
| 863 |
| 848 base::ThreadChecker thread_checker_; | 864 base::ThreadChecker thread_checker_; |
| 849 | 865 |
| 850 content::NotificationRegistrar registrar_; | 866 content::NotificationRegistrar registrar_; |
| 851 | 867 |
| 852 // The thread used by the history service to run complicated operations. | 868 // The thread used by the history service to run complicated operations. |
| 853 // |thread_| is NULL once |Cleanup| is NULL. | 869 // |thread_| is NULL once |Cleanup| is NULL. |
| 854 base::Thread* thread_; | 870 base::Thread* thread_; |
| 855 | 871 |
| 856 // This class has most of the implementation and runs on the 'thread_'. | 872 // This class has most of the implementation and runs on the 'thread_'. |
| 857 // You MUST communicate with this class ONLY through the thread_'s | 873 // You MUST communicate with this class ONLY through the thread_'s |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 | 913 |
| 898 history::DeleteDirectiveHandler delete_directive_handler_; | 914 history::DeleteDirectiveHandler delete_directive_handler_; |
| 899 | 915 |
| 900 // All vended weak pointers are invalidated in Cleanup(). | 916 // All vended weak pointers are invalidated in Cleanup(). |
| 901 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 917 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
| 902 | 918 |
| 903 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 919 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 904 }; | 920 }; |
| 905 | 921 |
| 906 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 922 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| OLD | NEW |