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_SERVICE_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "components/history/core/browser/typed_url_syncable_service.h" | 35 #include "components/history/core/browser/typed_url_syncable_service.h" |
36 #include "components/keyed_service/core/keyed_service.h" | 36 #include "components/keyed_service/core/keyed_service.h" |
37 #include "sql/init_status.h" | 37 #include "sql/init_status.h" |
38 #include "sync/api/syncable_service.h" | 38 #include "sync/api/syncable_service.h" |
39 #include "ui/base/page_transition_types.h" | 39 #include "ui/base/page_transition_types.h" |
40 | 40 |
41 class GURL; | 41 class GURL; |
42 class HistoryQuickProviderTest; | 42 class HistoryQuickProviderTest; |
43 class HistoryURLProvider; | 43 class HistoryURLProvider; |
44 class HistoryURLProviderTest; | 44 class HistoryURLProviderTest; |
| 45 class InMemoryURLIndex; |
45 class InMemoryURLIndexTest; | 46 class InMemoryURLIndexTest; |
46 class SkBitmap; | 47 class SkBitmap; |
47 class SyncBookmarkDataTypeControllerTest; | 48 class SyncBookmarkDataTypeControllerTest; |
48 class TestingProfile; | 49 class TestingProfile; |
49 | 50 |
| 51 // Forward-declare functions that will be friended by HistoryService. |
| 52 void BlockUntilInMemoryURLIndexIsRefreshed(InMemoryURLIndex* index); |
| 53 void RebuildInMemoryURLIndex(InMemoryURLIndex* index, |
| 54 history::HistoryService* history); |
| 55 |
50 namespace base { | 56 namespace base { |
51 class FilePath; | 57 class FilePath; |
52 class Thread; | 58 class Thread; |
53 } | 59 } |
54 | 60 |
55 namespace favicon { | 61 namespace favicon { |
56 class FaviconService; | 62 class FaviconService; |
57 } | 63 } |
58 | 64 |
59 namespace history { | 65 namespace history { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 private: | 580 private: |
575 class BackendDelegate; | 581 class BackendDelegate; |
576 friend class base::RefCountedThreadSafe<HistoryService>; | 582 friend class base::RefCountedThreadSafe<HistoryService>; |
577 friend class BackendDelegate; | 583 friend class BackendDelegate; |
578 friend class favicon::FaviconService; | 584 friend class favicon::FaviconService; |
579 friend class HistoryBackend; | 585 friend class HistoryBackend; |
580 friend class HistoryQueryTest; | 586 friend class HistoryQueryTest; |
581 friend class ::HistoryQuickProviderTest; | 587 friend class ::HistoryQuickProviderTest; |
582 friend class HistoryServiceTest; | 588 friend class HistoryServiceTest; |
583 friend class ::HistoryURLProvider; | 589 friend class ::HistoryURLProvider; |
584 friend class ::HistoryURLProviderTest; | |
585 friend class ::InMemoryURLIndexTest; | 590 friend class ::InMemoryURLIndexTest; |
586 friend class ::SyncBookmarkDataTypeControllerTest; | 591 friend class ::SyncBookmarkDataTypeControllerTest; |
587 friend class ::TestingProfile; | 592 friend class ::TestingProfile; |
| 593 friend void BlockUntilHistoryProcessesPendingRequests( |
| 594 HistoryService* history_service); |
| 595 friend scoped_ptr<HistoryService> CreateHistoryService( |
| 596 const base::FilePath& history_dir, |
| 597 const std::string& accept_languages, |
| 598 bool create_db); |
| 599 friend void ::BlockUntilInMemoryURLIndexIsRefreshed(InMemoryURLIndex* index); |
| 600 friend void ::RebuildInMemoryURLIndex(InMemoryURLIndex* index, |
| 601 history::HistoryService* history); |
588 | 602 |
589 // Called on shutdown, this will tell the history backend to complete and | 603 // Called on shutdown, this will tell the history backend to complete and |
590 // will release pointers to it. No other functions should be called once | 604 // will release pointers to it. No other functions should be called once |
591 // cleanup has happened that may dispatch to the history thread (because it | 605 // cleanup has happened that may dispatch to the history thread (because it |
592 // will be null). | 606 // will be null). |
593 // | 607 // |
594 // In practice, this will be called by the service manager (BrowserProcess) | 608 // In practice, this will be called by the service manager (BrowserProcess) |
595 // when it is being destroyed. Because that reference is being destroyed, it | 609 // when it is being destroyed. Because that reference is being destroyed, it |
596 // should be impossible for anybody else to call the service, even if it is | 610 // should be impossible for anybody else to call the service, even if it is |
597 // still in memory (pending requests may be holding a reference to us). | 611 // still in memory (pending requests may be holding a reference to us). |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 | 878 |
865 // All vended weak pointers are invalidated in Cleanup(). | 879 // All vended weak pointers are invalidated in Cleanup(). |
866 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 880 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
867 | 881 |
868 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 882 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
869 }; | 883 }; |
870 | 884 |
871 } // namespace history | 885 } // namespace history |
872 | 886 |
873 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 887 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
OLD | NEW |