| 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_CONTENT_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H_ | 5 #ifndef COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H_ |
| 6 #define COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H_ | 6 #define COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_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 "components/keyed_service/core/dependency_manager.h" | 10 #include "components/keyed_service/core/dependency_manager.h" |
| 11 #include "components/keyed_service/core/keyed_service_export.h" | 11 #include "components/keyed_service/core/keyed_service_export.h" |
| 12 | 12 |
| 13 class BrowserContextKeyedBaseFactory; | 13 class BrowserContextKeyedBaseFactory; |
| 14 |
| 15 namespace base { |
| 14 template <typename T> | 16 template <typename T> |
| 15 struct DefaultSingletonTraits; | 17 struct DefaultSingletonTraits; |
| 18 } // namespace base |
| 16 | 19 |
| 17 namespace content { | 20 namespace content { |
| 18 class BrowserContext; | 21 class BrowserContext; |
| 19 } | 22 } |
| 20 | 23 |
| 21 namespace user_prefs { | 24 namespace user_prefs { |
| 22 class PrefRegistrySyncable; | 25 class PrefRegistrySyncable; |
| 23 } | 26 } |
| 24 | 27 |
| 25 // A singleton that listens for context destruction notifications and | 28 // A singleton that listens for context destruction notifications and |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // due to |context| aliasing a BrowserContext instance from a prior test | 76 // due to |context| aliasing a BrowserContext instance from a prior test |
| 74 // (i.e., 0xWhatever might be created, be destroyed, and then a new | 77 // (i.e., 0xWhatever might be created, be destroyed, and then a new |
| 75 // BrowserContext object might be created at 0xWhatever). | 78 // BrowserContext object might be created at 0xWhatever). |
| 76 void MarkBrowserContextLiveForTesting(content::BrowserContext* context); | 79 void MarkBrowserContextLiveForTesting(content::BrowserContext* context); |
| 77 #endif // NDEBUG | 80 #endif // NDEBUG |
| 78 | 81 |
| 79 static BrowserContextDependencyManager* GetInstance(); | 82 static BrowserContextDependencyManager* GetInstance(); |
| 80 | 83 |
| 81 private: | 84 private: |
| 82 friend class BrowserContextDependencyManagerUnittests; | 85 friend class BrowserContextDependencyManagerUnittests; |
| 83 friend struct DefaultSingletonTraits<BrowserContextDependencyManager>; | 86 friend struct base::DefaultSingletonTraits<BrowserContextDependencyManager>; |
| 84 | 87 |
| 85 // Helper function used by CreateBrowserContextServices[ForTest]. | 88 // Helper function used by CreateBrowserContextServices[ForTest]. |
| 86 void DoCreateBrowserContextServices(content::BrowserContext* context, | 89 void DoCreateBrowserContextServices(content::BrowserContext* context, |
| 87 bool is_testing_context); | 90 bool is_testing_context); |
| 88 | 91 |
| 89 BrowserContextDependencyManager(); | 92 BrowserContextDependencyManager(); |
| 90 ~BrowserContextDependencyManager() override; | 93 ~BrowserContextDependencyManager() override; |
| 91 | 94 |
| 92 #ifndef NDEBUG | 95 #ifndef NDEBUG |
| 93 // DependencyManager: | 96 // DependencyManager: |
| 94 void DumpContextDependencies(base::SupportsUserData* context) const final; | 97 void DumpContextDependencies(base::SupportsUserData* context) const final; |
| 95 #endif // NDEBUG | 98 #endif // NDEBUG |
| 96 | 99 |
| 97 // A list of callbacks to call just before executing | 100 // A list of callbacks to call just before executing |
| 98 // CreateBrowserContextServices() or CreateBrowserContextServicesForTest(). | 101 // CreateBrowserContextServices() or CreateBrowserContextServicesForTest(). |
| 99 base::CallbackList<void(content::BrowserContext*)> | 102 base::CallbackList<void(content::BrowserContext*)> |
| 100 will_create_browser_context_services_callbacks_; | 103 will_create_browser_context_services_callbacks_; |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 #endif // COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H
_ | 106 #endif // COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H
_ |
| OLD | NEW |