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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 class InMemoryHistoryBackend; | 47 class InMemoryHistoryBackend; |
48 class InMemoryURLIndex; | 48 class InMemoryURLIndex; |
49 class InMemoryURLIndexTest; | 49 class InMemoryURLIndexTest; |
50 class HistoryAddPageArgs; | 50 class HistoryAddPageArgs; |
51 class HistoryBackend; | 51 class HistoryBackend; |
52 class HistoryDatabase; | 52 class HistoryDatabase; |
53 struct HistoryDetails; | 53 struct HistoryDetails; |
54 class HistoryQueryTest; | 54 class HistoryQueryTest; |
55 class VisitFilter; | 55 class VisitFilter; |
56 class URLDatabase; | 56 class URLDatabase; |
57 class VisitDatabaseObserver; | |
57 } // namespace history | 58 } // namespace history |
58 | 59 |
59 | 60 |
60 // HistoryDBTask can be used to process arbitrary work on the history backend | 61 // HistoryDBTask can be used to process arbitrary work on the history backend |
61 // thread. HistoryDBTask is scheduled using HistoryService::ScheduleDBTask. | 62 // thread. HistoryDBTask is scheduled using HistoryService::ScheduleDBTask. |
62 // When HistoryBackend processes the task it invokes RunOnDBThread. Once the | 63 // When HistoryBackend processes the task it invokes RunOnDBThread. Once the |
63 // task completes and has not been canceled, DoneRunOnMainThread is invoked back | 64 // task completes and has not been canceled, DoneRunOnMainThread is invoked back |
64 // on the main thread. | 65 // on the main thread. |
65 class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> { | 66 class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> { |
66 public: | 67 public: |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
589 void StartTopSitesMigration(int backend_id); | 590 void StartTopSitesMigration(int backend_id); |
590 | 591 |
591 // Called by TopSites after the thumbnails were read and it is safe | 592 // Called by TopSites after the thumbnails were read and it is safe |
592 // to delete the thumbnails DB. | 593 // to delete the thumbnails DB. |
593 void OnTopSitesReady(); | 594 void OnTopSitesReady(); |
594 | 595 |
595 // Returns true if this looks like the type of URL we want to add to the | 596 // Returns true if this looks like the type of URL we want to add to the |
596 // history. We filter out some URLs such as JavaScript. | 597 // history. We filter out some URLs such as JavaScript. |
597 static bool CanAddURL(const GURL& url); | 598 static bool CanAddURL(const GURL& url); |
598 | 599 |
600 // Adds or removes observers for the VisitDatabase. Should be run in the | |
601 // thread in which the observer would like to be notified. | |
cbentzel
2012/04/12 21:16:36
Would it be easier to just add a callback here ins
tburkard
2012/04/12 21:32:37
I thought this observer was easier, due to the dif
| |
602 void AddVisitDatabaseObserver(history::VisitDatabaseObserver* observer); | |
603 void RemoveVisitDatabaseObserver(history::VisitDatabaseObserver* observer); | |
604 | |
599 protected: | 605 protected: |
600 virtual ~HistoryService(); | 606 virtual ~HistoryService(); |
601 | 607 |
602 // These are not currently used, hopefully we can do something in the future | 608 // These are not currently used, hopefully we can do something in the future |
603 // to ensure that the most important things happen first. | 609 // to ensure that the most important things happen first. |
604 enum SchedulePriority { | 610 enum SchedulePriority { |
605 PRIORITY_UI, // The highest priority (must respond to UI events). | 611 PRIORITY_UI, // The highest priority (must respond to UI events). |
606 PRIORITY_NORMAL, // Normal stuff like adding a page. | 612 PRIORITY_NORMAL, // Normal stuff like adding a page. |
607 PRIORITY_LOW, // Low priority things like indexing or expiration. | 613 PRIORITY_LOW, // Low priority things like indexing or expiration. |
608 }; | 614 }; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
897 // True if needs top site migration. | 903 // True if needs top site migration. |
898 bool needs_top_sites_migration_; | 904 bool needs_top_sites_migration_; |
899 | 905 |
900 // The index used for quick history lookups. | 906 // The index used for quick history lookups. |
901 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 907 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
902 | 908 |
903 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 909 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
904 }; | 910 }; |
905 | 911 |
906 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 912 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |