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

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

Issue 935663004: Add checkbox for reporting invalid TLS/SSL cert chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also record when users disable extended reporting Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/certificate_error_reporter.cc
diff --git a/chrome/browser/net/certificate_error_reporter.cc b/chrome/browser/net/certificate_error_reporter.cc
index 57e737fce6d530e8c87fdbab7736527ab0d8a418..8d35f5b10c66c457a09c735021fe8f348db4e62a 100644
--- a/chrome/browser/net/certificate_error_reporter.cc
+++ b/chrome/browser/net/certificate_error_reporter.cc
@@ -22,8 +22,11 @@ namespace chrome_browser_net {
CertificateErrorReporter::CertificateErrorReporter(
net::URLRequestContext* request_context,
- const GURL& upload_url)
- : request_context_(request_context), upload_url_(upload_url) {
+ const GURL& upload_url,
+ CookiesPreference cookies_preference)
+ : request_context_(request_context),
+ upload_url_(upload_url),
+ cookies_preference_(cookies_preference) {
DCHECK(!upload_url.is_empty());
}
@@ -47,8 +50,7 @@ void CertificateErrorReporter::SendReport(ReportType type,
// TODO(estark): Double-check that the user is opted in.
// TODO(estark): Temporarily, since this is no upload endpoint, just
// log the information.
- request.SerializeToString(&out);
- DVLOG(3) << "SSL report for " << hostname << ":\n" << out << "\n\n";
+ DVLOG(1) << "Would send certificate report for " << hostname;
break;
default:
NOTREACHED();
@@ -76,8 +78,10 @@ scoped_ptr<net::URLRequest> CertificateErrorReporter::CreateURLRequest(
net::URLRequestContext* context) {
scoped_ptr<net::URLRequest> request =
context->CreateRequest(upload_url_, net::DEFAULT_PRIORITY, this, NULL);
- request->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
- net::LOAD_DO_NOT_SAVE_COOKIES);
+ if (cookies_preference_ != SEND_COOKIES) {
+ request->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
+ net::LOAD_DO_NOT_SAVE_COOKIES);
+ }
Ryan Sleevi 2015/03/25 04:49:45 You haven't added code to test this (Edit: I see
estark 2015/03/25 05:34:33 Do I get bonus points for delivering both? (crbug
return request.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698