Index: chrome/browser/safe_browsing/certificate_reporting_metrics_provider.cc |
diff --git a/chrome/browser/safe_browsing/certificate_reporting_metrics_provider.cc b/chrome/browser/safe_browsing/certificate_reporting_metrics_provider.cc |
index b7304bc2d3d662bde51aa73d9cbc08fb4bb29d9b..4209433256434f95fd426c750bd6f769a63ad03f 100644 |
--- a/chrome/browser/safe_browsing/certificate_reporting_metrics_provider.cc |
+++ b/chrome/browser/safe_browsing/certificate_reporting_metrics_provider.cc |
@@ -14,4 +14,20 @@ CertificateReportingMetricsProvider::CertificateReportingMetricsProvider() {} |
CertificateReportingMetricsProvider::~CertificateReportingMetricsProvider() {} |
void CertificateReportingMetricsProvider::ProvideGeneralMetrics( |
- metrics::ChromeUserMetricsExtension* unused) {} |
+ metrics::ChromeUserMetricsExtension* unused) { |
+ ProfileManager* profile_manager = g_browser_process->profile_manager(); |
+ if (!profile_manager) |
+ return; |
+ |
+ // Do not try to create profile here if it does not exist, because this method |
+ // can be called during browser shutdown. |
+ Profile* profile = profile_manager->GetProfileByPath( |
+ profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir())); |
+ if (!profile) |
+ return; |
+ |
+ CertificateReportingService* service = |
+ CertificateReportingServiceFactory::GetForBrowserContext(profile); |
+ if (service) |
+ 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
|
+} |