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

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: revert accidental deletion (fixes failing CaptivePortal tests) 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
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.h ('k') | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..382d103a3626dc006e0be749357e4ebb0f783662 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,20 @@ void SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread(
threat_type, post_data);
}
+void SafeBrowsingUIManager::ReportInvalidCertificateChainOnIOThread(
+ const std::string& hostname,
+ const net::SSLInfo& ssl_info) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ // The service may delete the ping manager (i.e. when user disabling service,
+ // etc). This happens on the IO thread.
+ if (!sb_service_ || !sb_service_->ping_manager())
+ return;
+
+ sb_service_->ping_manager()->ReportInvalidCertificateChain(hostname,
+ ssl_info);
+}
+
// If the user had opted-in to send MalwareDetails, this gets called
// when the report is ready.
void SafeBrowsingUIManager::SendSerializedMalwareDetails(
@@ -305,4 +333,3 @@ bool SafeBrowsingUIManager::IsWhitelisted(const UnsafeResource& resource) {
}
return false;
}
-
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.h ('k') | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698