| 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 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 5 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 "BrowserContextDependencyManager::DoCreateBrowserContextServices") | 45 "BrowserContextDependencyManager::DoCreateBrowserContextServices") |
| 46 will_create_browser_context_services_callbacks_.Notify(context); | 46 will_create_browser_context_services_callbacks_.Notify(context); |
| 47 DependencyManager::CreateContextServices(context, is_testing_context); | 47 DependencyManager::CreateContextServices(context, is_testing_context); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void BrowserContextDependencyManager::DestroyBrowserContextServices( | 50 void BrowserContextDependencyManager::DestroyBrowserContextServices( |
| 51 content::BrowserContext* context) { | 51 content::BrowserContext* context) { |
| 52 DependencyManager::DestroyContextServices(context); | 52 DependencyManager::DestroyContextServices(context); |
| 53 } | 53 } |
| 54 | 54 |
| 55 scoped_ptr<base::CallbackList<void(content::BrowserContext*)>::Subscription> | 55 std::unique_ptr< |
| 56 base::CallbackList<void(content::BrowserContext*)>::Subscription> |
| 56 BrowserContextDependencyManager:: | 57 BrowserContextDependencyManager:: |
| 57 RegisterWillCreateBrowserContextServicesCallbackForTesting( | 58 RegisterWillCreateBrowserContextServicesCallbackForTesting( |
| 58 const base::Callback<void(content::BrowserContext*)>& callback) { | 59 const base::Callback<void(content::BrowserContext*)>& callback) { |
| 59 return will_create_browser_context_services_callbacks_.Add(callback); | 60 return will_create_browser_context_services_callbacks_.Add(callback); |
| 60 } | 61 } |
| 61 | 62 |
| 62 #ifndef NDEBUG | 63 #ifndef NDEBUG |
| 63 void BrowserContextDependencyManager::AssertBrowserContextWasntDestroyed( | 64 void BrowserContextDependencyManager::AssertBrowserContextWasntDestroyed( |
| 64 content::BrowserContext* context) { | 65 content::BrowserContext* context) { |
| 65 DependencyManager::AssertContextWasntDestroyed(context); | 66 DependencyManager::AssertContextWasntDestroyed(context); |
| 66 } | 67 } |
| 67 | 68 |
| 68 void BrowserContextDependencyManager::MarkBrowserContextLiveForTesting( | 69 void BrowserContextDependencyManager::MarkBrowserContextLiveForTesting( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 91 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 92 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 92 kDumpBrowserContextDependencyGraphFlag)) { | 93 kDumpBrowserContextDependencyGraphFlag)) { |
| 93 base::FilePath dot_file = | 94 base::FilePath dot_file = |
| 94 static_cast<const content::BrowserContext*>(context) | 95 static_cast<const content::BrowserContext*>(context) |
| 95 ->GetPath() | 96 ->GetPath() |
| 96 .AppendASCII("browser-context-dependencies.dot"); | 97 .AppendASCII("browser-context-dependencies.dot"); |
| 97 DumpDependenciesAsGraphviz("BrowserContext", dot_file); | 98 DumpDependenciesAsGraphviz("BrowserContext", dot_file); |
| 98 } | 99 } |
| 99 } | 100 } |
| 100 #endif // NDEBUG | 101 #endif // NDEBUG |
| OLD | NEW |