OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_KEYED_SERVICE_IOS_BROWSER_STATE_DEPENDENCY_MANAGER_H_ | 5 #ifndef COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_DEPENDENCY_MANAGER_H_ |
6 #define COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_DEPENDENCY_MANAGER_H_ | 6 #define COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_DEPENDENCY_MANAGER_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/callback_list.h" | 9 #include "base/callback_list.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/keyed_service/core/dependency_manager.h" | 11 #include "components/keyed_service/core/dependency_manager.h" |
12 #include "components/keyed_service/core/keyed_service_export.h" | 12 #include "components/keyed_service/core/keyed_service_export.h" |
13 | 13 |
| 14 namespace base { |
14 template <typename T> | 15 template <typename T> |
15 struct DefaultSingletonTraits; | 16 struct DefaultSingletonTraits; |
| 17 } // namespace base |
16 | 18 |
17 namespace web { | 19 namespace web { |
18 class BrowserState; | 20 class BrowserState; |
19 } | 21 } |
20 | 22 |
21 namespace user_prefs { | 23 namespace user_prefs { |
22 class PrefRegistrySyncable; | 24 class PrefRegistrySyncable; |
23 } | 25 } |
24 | 26 |
25 // A singleton that listens for context destruction notifications and | 27 // A singleton that listens for context destruction notifications and |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 64 |
63 // Marks |context| as live (i.e., not stale). This method can be called as a | 65 // Marks |context| as live (i.e., not stale). This method can be called as a |
64 // safeguard against |AssertBrowserStateWasntDestroyed()| checks going off | 66 // safeguard against |AssertBrowserStateWasntDestroyed()| checks going off |
65 // due to |context| aliasing a BrowserState instance from a prior test | 67 // due to |context| aliasing a BrowserState instance from a prior test |
66 // (i.e., 0xWhatever might be created, be destroyed, and then a new | 68 // (i.e., 0xWhatever might be created, be destroyed, and then a new |
67 // BrowserState object might be created at 0xWhatever). | 69 // BrowserState object might be created at 0xWhatever). |
68 void MarkBrowserStateLiveForTesting(web::BrowserState* context); | 70 void MarkBrowserStateLiveForTesting(web::BrowserState* context); |
69 #endif // NDEBUG | 71 #endif // NDEBUG |
70 | 72 |
71 private: | 73 private: |
72 friend struct DefaultSingletonTraits<BrowserStateDependencyManager>; | 74 friend struct base::DefaultSingletonTraits<BrowserStateDependencyManager>; |
73 | 75 |
74 BrowserStateDependencyManager(); | 76 BrowserStateDependencyManager(); |
75 ~BrowserStateDependencyManager() override; | 77 ~BrowserStateDependencyManager() override; |
76 | 78 |
77 // Helper function used by CreateBrowserStateServices[ForTest]. | 79 // Helper function used by CreateBrowserStateServices[ForTest]. |
78 void DoCreateBrowserStateServices(web::BrowserState* context, | 80 void DoCreateBrowserStateServices(web::BrowserState* context, |
79 bool is_testing_context); | 81 bool is_testing_context); |
80 | 82 |
81 #ifndef NDEBUG | 83 #ifndef NDEBUG |
82 // DependencyManager: | 84 // DependencyManager: |
83 void DumpContextDependencies(base::SupportsUserData* context) const final; | 85 void DumpContextDependencies(base::SupportsUserData* context) const final; |
84 #endif // NDEBUG | 86 #endif // NDEBUG |
85 | 87 |
86 DISALLOW_COPY_AND_ASSIGN(BrowserStateDependencyManager); | 88 DISALLOW_COPY_AND_ASSIGN(BrowserStateDependencyManager); |
87 }; | 89 }; |
88 | 90 |
89 #endif // COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_DEPENDENCY_MANAGER_H_ | 91 #endif // COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_DEPENDENCY_MANAGER_H_ |
OLD | NEW |