OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h" | 5 #include "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
9 #include "chrome/browser/safe_browsing/certificate_reporting_service.h" | 9 #include "chrome/browser/safe_browsing/certificate_reporting_service.h" |
10 #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h" | 10 #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h" |
11 | 11 |
12 CertificateReportingMetricsProvider::CertificateReportingMetricsProvider() {} | 12 CertificateReportingMetricsProvider::CertificateReportingMetricsProvider() {} |
13 | 13 |
14 CertificateReportingMetricsProvider::~CertificateReportingMetricsProvider() {} | 14 CertificateReportingMetricsProvider::~CertificateReportingMetricsProvider() {} |
15 | 15 |
16 void CertificateReportingMetricsProvider::ProvideGeneralMetrics( | 16 void CertificateReportingMetricsProvider::ProvideGeneralMetrics( |
17 metrics::ChromeUserMetricsExtension* unused) {} | 17 metrics::ChromeUserMetricsExtension* unused) { |
18 ProfileManager* profile_manager = g_browser_process->profile_manager(); | |
19 if (!profile_manager) | |
20 return; | |
21 | |
22 // Do not try to create profile here if it does not exist, because this method | |
23 // can be called during browser shutdown. | |
24 Profile* profile = profile_manager->GetProfileByPath( | |
25 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir())); | |
26 if (!profile) | |
27 return; | |
28 | |
29 CertificateReportingService* service = | |
30 CertificateReportingServiceFactory::GetForBrowserContext(profile); | |
31 if (service) | |
32 service->SendPending(); | |
Ilya Sherman
2016/12/22 01:41:57
Hmm, this doesn't look like it's actually related
meacer
2016/12/22 18:50:04
Sorry, I split this feature into multiple CLs and
Ilya Sherman
2016/12/22 22:00:08
Okay, that kind of makes sense. I'm not 100% sure
meacer
2016/12/22 22:23:36
Sure, expanded the documentation a bit. Hopefully
| |
33 } | |
OLD | NEW |