Chromium Code Reviews| Index: chrome/browser/net/cert_database_service_factory.cc |
| diff --git a/chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc b/chrome/browser/net/cert_database_service_factory.cc |
| similarity index 40% |
| copy from chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc |
| copy to chrome/browser/net/cert_database_service_factory.cc |
| index 8394c2f38f3cb6b15587ac8798775389760d9eed..bf2b889eb182ae1ce6efcd4eda7c1b5449e58bdf 100644 |
| --- a/chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc |
| +++ b/chrome/browser/net/cert_database_service_factory.cc |
| @@ -2,50 +2,47 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/chromeos/platform_keys/platform_keys_service_factory.h" |
| +#include "chrome/browser/net/cert_database_service_factory.h" |
| -#include "base/logging.h" |
| #include "base/memory/singleton.h" |
| -#include "chrome/browser/chromeos/platform_keys/platform_keys_service.h" |
| -#include "chrome/browser/extensions/extension_system_factory.h" |
| #include "chrome/browser/profiles/incognito_helpers.h" |
| +#include "components/cert_database/public/cert_database_service.h" |
| #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| -namespace chromeos { |
| +namespace cert_database { |
| // static |
| -PlatformKeysService* PlatformKeysServiceFactory::GetForBrowserContext( |
| +CertDatabaseService* CertDatabaseServiceFactory::GetForBrowserContext( |
| content::BrowserContext* context) { |
| - return static_cast<PlatformKeysService*>( |
| + return static_cast<CertDatabaseService*>( |
| GetInstance()->GetServiceForBrowserContext(context, true)); |
| } |
| // static |
| -PlatformKeysServiceFactory* PlatformKeysServiceFactory::GetInstance() { |
| - return Singleton<PlatformKeysServiceFactory>::get(); |
| +CertDatabaseServiceFactory* CertDatabaseServiceFactory::GetInstance() { |
| + return Singleton<CertDatabaseServiceFactory>::get(); |
| } |
| -PlatformKeysServiceFactory::PlatformKeysServiceFactory() |
| +CertDatabaseServiceFactory::CertDatabaseServiceFactory() |
| : BrowserContextKeyedServiceFactory( |
| - "PlatformKeysService", |
| + "CertDatabaseService", |
| BrowserContextDependencyManager::GetInstance()) { |
| - DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
| } |
| -PlatformKeysServiceFactory::~PlatformKeysServiceFactory() { |
| +CertDatabaseServiceFactory::~CertDatabaseServiceFactory() { |
| } |
| -content::BrowserContext* PlatformKeysServiceFactory::GetBrowserContextToUse( |
| +content::BrowserContext* CertDatabaseServiceFactory::GetBrowserContextToUse( |
| content::BrowserContext* context) const { |
| return chrome::GetBrowserContextRedirectedInIncognito(context); |
|
Joao da Silva
2014/10/30 09:48:01
Is this a good idea? Should the CertDatabaseServic
pneubeck (no reviews)
2014/11/05 14:53:36
My understanding is that although we created a sep
|
| } |
| -KeyedService* PlatformKeysServiceFactory::BuildServiceInstanceFor( |
| - content::BrowserContext* context) const { |
| - extensions::StateStore* store = |
| - extensions::ExtensionSystem::Get(context)->state_store(); |
| - DCHECK(store); |
| - return new PlatformKeysService(context, store); |
| +bool CertDatabaseServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
| + // TODO(pneubeck): Once CertLoader is not a separate singleton anymore, we can |
| + // consider creating the CertDatabaseService on demand. But for now it's |
| + // important that the NSS initialization is always triggered on browser |
| + // startup. |
| + return true; |
| } |
| -} // namespace chromeos |
| +} // namespace cert_database |