Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5669)

Unified Diff: chrome/browser/net/cert_database_service_factory.cc

Issue 419013003: Replace c/b/nss_context by a KeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Flattened components/cert_database folders. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0941c0030d2b6466a7ebd642ff3e8124eca0931f 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/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);
}
-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
« no previous file with comments | « chrome/browser/net/cert_database_service_factory.h ('k') | chrome/browser/net/cert_database_service_factory_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698