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

Unified Diff: chrome/browser/safe_browsing/ui_manager.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: use SecurityInterstitialMetricsHelper for extended reporting events 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/safe_browsing/ui_manager.cc
diff --git a/chrome/browser/safe_browsing/ui_manager.cc b/chrome/browser/safe_browsing/ui_manager.cc
index 45728d35409b0ae387b9f42c187e36049775c98e..1ccd79da75787c57927116216eb5878d1272328d 100644
--- a/chrome/browser/safe_browsing/ui_manager.cc
+++ b/chrome/browser/safe_browsing/ui_manager.cc
@@ -26,6 +26,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_contents.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include "net/ssl/ssl_info.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
@@ -213,6 +214,19 @@ void SafeBrowsingUIManager::ReportSafeBrowsingHit(
threat_type, post_data));
}
+void SafeBrowsingUIManager::ReportInvalidCertificateChain(
+ const std::string& hostname,
+ const net::SSLInfo& ssl_info,
+ const base::Closure& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BrowserThread::PostTaskAndReply(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(
+ &SafeBrowsingUIManager::ReportInvalidCertificateChainOnIOThread, this,
+ hostname, ssl_info),
+ callback);
+}
+
void SafeBrowsingUIManager::AddObserver(Observer* observer) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
observer_list_.AddObserver(observer);
@@ -246,6 +260,14 @@ void SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread(
threat_type, post_data);
}
+void SafeBrowsingUIManager::ReportInvalidCertificateChainOnIOThread(
+ const std::string& hostname,
+ const net::SSLInfo& ssl_info) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ sb_service_->ping_manager()->ReportInvalidCertificateChain(hostname,
mattm 2015/03/23 05:31:17 This should have null checks like in SendSerialize
estark 2015/03/23 16:42:13 Done.
+ ssl_info);
+}
+
// If the user had opted-in to send MalwareDetails, this gets called
// when the report is ready.
void SafeBrowsingUIManager::SendSerializedMalwareDetails(
@@ -305,4 +327,3 @@ bool SafeBrowsingUIManager::IsWhitelisted(const UnsafeResource& resource) {
}
return false;
}
-

Powered by Google App Engine
This is Rietveld 408576698