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

Unified Diff: chrome/browser/ui/webui/interstitials/interstitial_ui.cc

Issue 2540853005: Test interstitials shouldn't use null SSLCertReporters (Closed)
Patch Set: Fix the checks Created 4 years 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/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/interstitials/interstitial_ui.cc
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
index dd641b5459b71fea4263b28df3e424e9ecde91a1..90356db18be1c6b70f4e3fb34cc5665e1e053f81 100644
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/safe_browsing/ui_manager.h"
#include "chrome/browser/ssl/bad_clock_blocking_page.h"
#include "chrome/browser/ssl/ssl_blocking_page.h"
+#include "chrome/browser/ssl/ssl_cert_reporter.h"
#include "chrome/common/features.h"
#include "chrome/common/url_constants.h"
#include "components/grit/components_resources.h"
@@ -40,6 +41,13 @@
namespace {
+class EmptySSLCertReporter : public SSLCertReporter {
+ public:
+ // SSLCertReporter methods:
+ void ReportInvalidCertificateChain(
+ const std::string& serialized_report) override {}
+};
+
// NSS requires that serial numbers be unique even for the same issuer;
// as all fake certificates will contain the same issuer name, it's
// necessary to ensure the serial number is unique, as otherwise
@@ -97,12 +105,13 @@ class CaptivePortalBlockingPageWithNetInfo : public CaptivePortalBlockingPage {
callback,
bool is_wifi,
const std::string& wifi_ssid)
- : CaptivePortalBlockingPage(web_contents,
- request_url,
- login_url,
- nullptr,
- ssl_info,
- callback),
+ : CaptivePortalBlockingPage(
+ web_contents,
+ request_url,
+ login_url,
+ std::unique_ptr<SSLCertReporter>(new EmptySSLCertReporter()),
+ ssl_info,
+ callback),
is_wifi_(is_wifi),
wifi_ssid_(wifi_ssid) {}
@@ -154,7 +163,8 @@ SSLBlockingPage* CreateSSLBlockingPage(content::WebContents* web_contents) {
options_mask |= security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT;
return SSLBlockingPage::Create(
web_contents, cert_error, ssl_info, request_url, options_mask,
- time_triggered_, nullptr,
+ time_triggered_,
+ std::unique_ptr<SSLCertReporter>(new EmptySSLCertReporter()),
base::Callback<void(content::CertificateRequestResultType)>());
}
@@ -203,7 +213,7 @@ BadClockBlockingPage* CreateBadClockBlockingPage(
options_mask |= security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT;
return new BadClockBlockingPage(
web_contents, cert_error, ssl_info, request_url, base::Time::Now(),
- clock_state, nullptr,
+ clock_state, std::unique_ptr<SSLCertReporter>(new EmptySSLCertReporter()),
base::Callback<void(content::CertificateRequestResultType)>());
}
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698