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

Side by Side Diff: chrome/browser/safe_browsing/certificate_reporting_service.cc

Issue 2677703003: Fix Safe Browsing cert reports URL (Closed)
Patch Set: Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/safe_browsing/certificate_reporting_service.h" 4 #include "chrome/browser/safe_browsing/certificate_reporting_service.h"
5 5
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "base/time/clock.h" 9 #include "base/time/clock.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 12 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
13 #include "components/certificate_reporting/error_report.h" 13 #include "components/certificate_reporting/error_report.h"
14 #include "components/prefs/pref_service.h" 14 #include "components/prefs/pref_service.h"
15 #include "components/safe_browsing_db/safe_browsing_prefs.h" 15 #include "components/safe_browsing_db/safe_browsing_prefs.h"
16 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
17 17
18 namespace { 18 namespace {
19 19
20 // URL to upload invalid certificate chain reports. An HTTP URL is used because 20 // URL to upload invalid certificate chain reports. An HTTP URL is used because
21 // a client seeing an invalid cert might not be able to make an HTTPS connection 21 // a client seeing an invalid cert might not be able to make an HTTPS connection
22 // to report it. 22 // to report it.
23 const char kExtendedReportingUploadUrl[] = 23 const char kExtendedReportingUploadUrl[] =
24 "http://safebrowsing.googleusercontent.com/safebrowsing/clientreport/"; 24 "http://safebrowsing.googleusercontent.com/safebrowsing/clientreport/"
25 "chrome-certs";
25 26
26 // Compare function that orders Reports in reverse chronological order (i.e. 27 // Compare function that orders Reports in reverse chronological order (i.e.
27 // oldest item is last). 28 // oldest item is last).
28 bool ReportCompareFunc(const CertificateReportingService::Report& item1, 29 bool ReportCompareFunc(const CertificateReportingService::Report& item1,
29 const CertificateReportingService::Report& item2) { 30 const CertificateReportingService::Report& item2) {
30 return item1.creation_time > item2.creation_time; 31 return item1.creation_time > item2.creation_time;
31 } 32 }
32 33
33 // Records an UMA histogram of the net errors when certificate reports 34 // Records an UMA histogram of the net errors when certificate reports
34 // fail to send. 35 // fail to send.
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 321 }
321 322
322 void CertificateReportingService::OnPreferenceChanged() { 323 void CertificateReportingService::OnPreferenceChanged() {
323 safe_browsing::SafeBrowsingService* safe_browsing_service_ = 324 safe_browsing::SafeBrowsingService* safe_browsing_service_ =
324 g_browser_process->safe_browsing_service(); 325 g_browser_process->safe_browsing_service();
325 const bool enabled = safe_browsing_service_ && 326 const bool enabled = safe_browsing_service_ &&
326 safe_browsing_service_->enabled_by_prefs() && 327 safe_browsing_service_->enabled_by_prefs() &&
327 safe_browsing::IsExtendedReportingEnabled(pref_service_); 328 safe_browsing::IsExtendedReportingEnabled(pref_service_);
328 SetEnabled(enabled); 329 SetEnabled(enabled);
329 } 330 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698