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

Unified Diff: chrome/browser/safe_browsing/certificate_reporting_service_factory.cc

Issue 2507253004: Add factory class for CertificateReportingService and a new metrics provider. (Closed)
Patch Set: Move classes to safe_browsing, estark comment Created 4 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
« no previous file with comments | « chrome/browser/safe_browsing/certificate_reporting_service_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/certificate_reporting_service_factory.cc
diff --git a/chrome/browser/safe_browsing/certificate_reporting_service_factory.cc b/chrome/browser/safe_browsing/certificate_reporting_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bed32fdb06b1b7fe9c513880f4fc3159504eeff4
--- /dev/null
+++ b/chrome/browser/safe_browsing/certificate_reporting_service_factory.cc
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/safe_browsing/certificate_reporting_service.h"
+#include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+// static
+CertificateReportingServiceFactory*
+CertificateReportingServiceFactory::GetInstance() {
+ return base::Singleton<CertificateReportingServiceFactory>::get();
+}
+
+// static
+CertificateReportingService*
+CertificateReportingServiceFactory::GetForBrowserContext(
+ content::BrowserContext* context) {
+ return static_cast<CertificateReportingService*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+CertificateReportingServiceFactory::CertificateReportingServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "cert_reporting::Factory",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+CertificateReportingServiceFactory::~CertificateReportingServiceFactory() {}
+
+KeyedService* CertificateReportingServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new CertificateReportingService();
+}
+
+content::BrowserContext*
+CertificateReportingServiceFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return context;
+}
« no previous file with comments | « chrome/browser/safe_browsing/certificate_reporting_service_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698