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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 21 matching lines...) Expand all Loading... | |
32 #include "components/visitedlink/browser/visitedlink_delegate.h" | 32 #include "components/visitedlink/browser/visitedlink_delegate.h" |
33 #include "sql/init_status.h" | 33 #include "sql/init_status.h" |
34 #include "sync/api/syncable_service.h" | 34 #include "sync/api/syncable_service.h" |
35 #include "ui/base/page_transition_types.h" | 35 #include "ui/base/page_transition_types.h" |
36 | 36 |
37 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
38 class AndroidHistoryProviderService; | 38 class AndroidHistoryProviderService; |
39 #endif | 39 #endif |
40 | 40 |
41 class GURL; | 41 class GURL; |
42 class HistoryService; | |
43 struct ImportedFaviconUsage; | |
42 class PageUsageData; | 44 class PageUsageData; |
43 class PageUsageRequest; | 45 class PageUsageRequest; |
44 class Profile; | 46 class Profile; |
45 struct ImportedFaviconUsage; | |
46 class SkBitmap; | 47 class SkBitmap; |
47 | 48 |
48 namespace base { | 49 namespace base { |
49 class FilePath; | 50 class FilePath; |
50 class Thread; | 51 class Thread; |
51 } | 52 } |
52 | 53 |
53 namespace visitedlink { | 54 namespace visitedlink { |
54 class VisitedLinkMaster; | 55 class VisitedLinkMaster; |
55 } | 56 } |
56 | 57 |
57 namespace history { | 58 namespace history { |
58 | 59 |
60 struct DownloadRow; | |
61 struct HistoryAddPageArgs; | |
59 class HistoryBackend; | 62 class HistoryBackend; |
60 class HistoryClient; | 63 class HistoryClient; |
64 class HistoryDBTask; | |
61 class HistoryDatabase; | 65 class HistoryDatabase; |
62 struct HistoryDatabaseParams; | 66 struct HistoryDatabaseParams; |
63 class HistoryDBTask; | |
64 class HistoryQueryTest; | 67 class HistoryQueryTest; |
65 class HistoryServiceObserver; | 68 class HistoryServiceObserver; |
66 class HistoryTest; | 69 class HistoryTest; |
67 class InMemoryHistoryBackend; | 70 class InMemoryHistoryBackend; |
68 class InMemoryURLIndex; | 71 class InMemoryURLIndex; |
69 class InMemoryURLIndexTest; | 72 class InMemoryURLIndexTest; |
73 struct KeywordSearchTermVisit; | |
70 class URLDatabase; | 74 class URLDatabase; |
71 class VisitFilter; | 75 class VisitFilter; |
72 struct DownloadRow; | 76 class WebHistoryService; |
73 struct HistoryAddPageArgs; | 77 |
74 struct KeywordSearchTermVisit; | 78 void ExpireLocalAndRemoteHistoryBetween(HistoryService* local_history, |
droger
2015/02/05 16:16:13
This looks like a mistake, the function is also de
| |
79 WebHistoryService* web_history, | |
80 const std::set<GURL>& restrict_urls, | |
81 base::Time begin_time, | |
82 base::Time end_time, | |
83 const base::Closure& callback, | |
84 base::CancelableTaskTracker* tracker); | |
75 | 85 |
76 } // namespace history | 86 } // namespace history |
77 | 87 |
78 // The history service records page titles, and visit times, as well as | 88 // The history service records page titles, and visit times, as well as |
79 // (eventually) information about autocomplete. | 89 // (eventually) information about autocomplete. |
80 // | 90 // |
81 // This service is thread safe. Each request callback is invoked in the | 91 // This service is thread safe. Each request callback is invoked in the |
82 // thread that made the request. | 92 // thread that made the request. |
83 class HistoryService : public syncer::SyncableService, | 93 class HistoryService : public syncer::SyncableService, |
84 public KeyedService, | 94 public KeyedService, |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 base::CancelableTaskTracker* tracker); | 354 base::CancelableTaskTracker* tracker); |
345 | 355 |
346 // Removes all visits to specified URLs in specific time ranges. | 356 // Removes all visits to specified URLs in specific time ranges. |
347 // This is the equivalent ExpireHistoryBetween() once for each element in the | 357 // This is the equivalent ExpireHistoryBetween() once for each element in the |
348 // vector. The fields of |ExpireHistoryArgs| map directly to the arguments of | 358 // vector. The fields of |ExpireHistoryArgs| map directly to the arguments of |
349 // of ExpireHistoryBetween(). | 359 // of ExpireHistoryBetween(). |
350 void ExpireHistory(const std::vector<history::ExpireHistoryArgs>& expire_list, | 360 void ExpireHistory(const std::vector<history::ExpireHistoryArgs>& expire_list, |
351 const base::Closure& callback, | 361 const base::Closure& callback, |
352 base::CancelableTaskTracker* tracker); | 362 base::CancelableTaskTracker* tracker); |
353 | 363 |
354 // Removes all visits to the given URLs in the specified time range. Calls | |
355 // ExpireHistoryBetween() to delete local visits, and handles deletion of | |
356 // synced visits if appropriate. | |
357 void ExpireLocalAndRemoteHistoryBetween(const std::set<GURL>& restrict_urls, | |
358 base::Time begin_time, | |
359 base::Time end_time, | |
360 const base::Closure& callback, | |
361 base::CancelableTaskTracker* tracker); | |
362 | |
363 // Processes the given |delete_directive| and sends it to the | 364 // Processes the given |delete_directive| and sends it to the |
364 // SyncChangeProcessor (if it exists). Returns any error resulting | 365 // SyncChangeProcessor (if it exists). Returns any error resulting |
365 // from sending the delete directive to sync. | 366 // from sending the delete directive to sync. |
366 syncer::SyncError ProcessLocalDeleteDirective( | 367 syncer::SyncError ProcessLocalDeleteDirective( |
367 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); | 368 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); |
368 | 369 |
369 // Downloads ----------------------------------------------------------------- | 370 // Downloads ----------------------------------------------------------------- |
370 | 371 |
371 // Implemented by the caller of 'CreateDownload' below, and is called when the | 372 // Implemented by the caller of 'CreateDownload' below, and is called when the |
372 // history service has created a new entry for a download in the history db. | 373 // history service has created a new entry for a download in the history db. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 friend class history::HistoryTest; | 541 friend class history::HistoryTest; |
541 friend class HistoryURLProvider; | 542 friend class HistoryURLProvider; |
542 friend class HistoryURLProviderTest; | 543 friend class HistoryURLProviderTest; |
543 friend class history::InMemoryURLIndexTest; | 544 friend class history::InMemoryURLIndexTest; |
544 template<typename Info, typename Callback> friend class DownloadRequest; | 545 template<typename Info, typename Callback> friend class DownloadRequest; |
545 friend class PageUsageRequest; | 546 friend class PageUsageRequest; |
546 friend class RedirectRequest; | 547 friend class RedirectRequest; |
547 friend class SyncBookmarkDataTypeControllerTest; | 548 friend class SyncBookmarkDataTypeControllerTest; |
548 friend class TestingProfile; | 549 friend class TestingProfile; |
549 | 550 |
551 friend void history::ExpireLocalAndRemoteHistoryBetween( | |
552 HistoryService* local_history, | |
553 history::WebHistoryService* web_history, | |
554 const std::set<GURL>& restrict_urls, | |
555 base::Time begin_time, | |
556 base::Time end_time, | |
557 const base::Closure& callback, | |
558 base::CancelableTaskTracker* tracker); | |
559 | |
550 // Called on shutdown, this will tell the history backend to complete and | 560 // Called on shutdown, this will tell the history backend to complete and |
551 // will release pointers to it. No other functions should be called once | 561 // will release pointers to it. No other functions should be called once |
552 // cleanup has happened that may dispatch to the history thread (because it | 562 // cleanup has happened that may dispatch to the history thread (because it |
553 // will be NULL). | 563 // will be NULL). |
554 // | 564 // |
555 // In practice, this will be called by the service manager (BrowserProcess) | 565 // In practice, this will be called by the service manager (BrowserProcess) |
556 // when it is being destroyed. Because that reference is being destroyed, it | 566 // when it is being destroyed. Because that reference is being destroyed, it |
557 // should be impossible for anybody else to call the service, even if it is | 567 // should be impossible for anybody else to call the service, even if it is |
558 // still in memory (pending requests may be holding a reference to us). | 568 // still in memory (pending requests may be holding a reference to us). |
559 void Cleanup(); | 569 void Cleanup(); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
809 // A cache of the user-typed URLs kept in memory that is used by the | 819 // A cache of the user-typed URLs kept in memory that is used by the |
810 // autocomplete system. This will be NULL until the database has been created | 820 // autocomplete system. This will be NULL until the database has been created |
811 // on the background thread. | 821 // on the background thread. |
812 // TODO(mrossetti): Consider changing ownership. See http://crbug.com/138321 | 822 // TODO(mrossetti): Consider changing ownership. See http://crbug.com/138321 |
813 scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_; | 823 scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_; |
814 | 824 |
815 // The history client, may be null when testing. The object should otherwise | 825 // The history client, may be null when testing. The object should otherwise |
816 // outlive |HistoryService|. | 826 // outlive |HistoryService|. |
817 history::HistoryClient* history_client_; | 827 history::HistoryClient* history_client_; |
818 | 828 |
819 // The profile, may be null when testing. | |
820 Profile* profile_; | |
821 | |
822 // Used for propagating link highlighting data across renderers. May be null | 829 // Used for propagating link highlighting data across renderers. May be null |
823 // in tests. | 830 // in tests. |
824 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; | 831 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; |
825 | 832 |
826 // Has the backend finished loading? The backend is loaded once Init has | 833 // Has the backend finished loading? The backend is loaded once Init has |
827 // completed. | 834 // completed. |
828 bool backend_loaded_; | 835 bool backend_loaded_; |
829 | 836 |
830 // Cached values from Init(), used whenever we need to reload the backend. | 837 // Cached values from Init(), used whenever we need to reload the backend. |
831 base::FilePath history_dir_; | 838 base::FilePath history_dir_; |
(...skipping 10 matching lines...) Expand all Loading... | |
842 | 849 |
843 history::DeleteDirectiveHandler delete_directive_handler_; | 850 history::DeleteDirectiveHandler delete_directive_handler_; |
844 | 851 |
845 // All vended weak pointers are invalidated in Cleanup(). | 852 // All vended weak pointers are invalidated in Cleanup(). |
846 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 853 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
847 | 854 |
848 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 855 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
849 }; | 856 }; |
850 | 857 |
851 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 858 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |