Commit 30645e2f authored by Peter Williamson's avatar Peter Williamson Committed by Commit Bot

Revert "Refactor SSLCertificateErrorPageController"

This reverts commit 08c128cd.

Reason for revert: Reverterd on suspicion of causing build failures on Mac 10.11

TBR: carlosil@chromium.org

failures:
SSLClientSocketReadTest.Read/1
SSLClientSocketReadTest.Read/0
HTTPSEVCRLSetTest.FreshCRLSetNotCovered
WebSocketEndToEndTest.BasicSmokeTest
SSLClientSocketReadTest.DumpMemoryStats/0
SSLClientSocketReadTest.DumpMemoryStats/1
URLRequestTestFTP.FTPCheckWrongUser
WebSocketEndToEndTest.TruncatedResponse
WebSocketEndToEndTest.HstsWebSocketToWebSocket
WebSocketEndToEndTest.TrailingWhitespace
HTTPSOCSPTest.IntermediateResponseTooOld
URLRequestTestFTP.FTPCheckWrongUserRestart
URLRequestTestFTP.FTPCheckWrongPasswordRestart
HTTPSOCSPTest.Revoked
HTTPSFallbackTest.TLSv1_1NoFallback
HTTPSFallbackTest.TLSv1_3Interference
URLRequestTestFTP.FTPCheckWrongPassword
WebSocketEndToEndTest.HeaderContinuations
HTTPSCRLSetTest.ExpiredCRLSetAndRevoked
HTTPSEVCRLSetTest.FreshCRLSetCovered
SSLClientSocketReadTest.Read_DeleteWhilePendingFullDuplex/1
SSLClientSocketReadTest.Read_DeleteWhilePendingFullDuplex/0
OCSPVerify/HTTPSOCSPVerifyTest.VerifyResult/18
HTTPSOCSPTest.Valid
HTTPSEVCRLSetTest.ExpiredCRLSet
OCSPVerify/HTTPSOCSPVerifyTest.VerifyResult/12
OCSPVerify/HTTPSOCSPVerifyTest.VerifyResult/13
OCSPVerify/HTTPSOCSPVerifyTest.VerifyResult/10
OCSPVerify/HTTPSOCSPVerifyTest.VerifyResult/11
OCSPVerify/HTTPSOCSPVerifyTest.VerifyResult/16
… 70 more (100 total) …

Original change's description:
> Refactor SSLCertificateErrorPageController
>
> SSLCertificateErrorPageController is no longer only used on SSL errors,
> renamed it to SecurityInterstitialErrorPageController, and removed the
> net::Error code passed to EnablePageHelperFunctions since it's no
> longer used.
>
> Bug: 910794
> Change-Id: I718e0fcbcb2643cb0c47818dda1f317aef4e75cc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1503910
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Commit-Queue: Carlos IL <carlosil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#638232}

TBR=sky@chromium.org,mmenke@chromium.org,carlosil@chromium.org

Change-Id: I39489effa3e0029b5ff65f5bc9cbd991aef1ddea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 910794
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1507039Reviewed-by: default avatarPeter Williamson <petewil@chromium.org>
Commit-Queue: Peter Williamson <petewil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638363}
parent cdc92f96
......@@ -102,8 +102,8 @@ jumbo_static_library("renderer") {
"sandbox_status_extension_android.h",
"security_filter_peer.cc",
"security_filter_peer.h",
"security_interstitials/security_interstitial_page_controller.cc",
"security_interstitials/security_interstitial_page_controller.h",
"ssl/ssl_certificate_error_page_controller.cc",
"ssl/ssl_certificate_error_page_controller.h",
"supervised_user/supervised_user_error_page_controller.cc",
"supervised_user/supervised_user_error_page_controller.h",
"tts_dispatcher.cc",
......
......@@ -24,7 +24,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/chrome_render_thread_observer.h"
#include "chrome/renderer/security_interstitials/security_interstitial_page_controller.h"
#include "chrome/renderer/ssl/ssl_certificate_error_page_controller.h"
#include "chrome/renderer/supervised_user/supervised_user_error_page_controller.h"
#include "components/error_page/common/error.h"
#include "components/error_page/common/error_page_params.h"
......@@ -167,7 +167,7 @@ NetErrorHelper::NetErrorHelper(RenderFrame* render_frame)
: RenderFrameObserver(render_frame),
content::RenderFrameObserverTracker<NetErrorHelper>(render_frame),
weak_controller_delegate_factory_(this),
weak_security_interstitial_controller_delegate_factory_(this),
weak_ssl_error_controller_delegate_factory_(this),
weak_supervised_user_error_controller_delegate_factory_(this) {
RenderThread::Get()->AddObserver(this);
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
......@@ -324,7 +324,7 @@ void NetErrorHelper::DidCommitProvisionalLoad(bool is_same_document_navigation,
// error page, the controller has not yet been attached, so this won't affect
// it.
weak_controller_delegate_factory_.InvalidateWeakPtrs();
weak_security_interstitial_controller_delegate_factory_.InvalidateWeakPtrs();
weak_ssl_error_controller_delegate_factory_.InvalidateWeakPtrs();
weak_supervised_user_error_controller_delegate_factory_.InvalidateWeakPtrs();
core_->OnCommitLoad(GetFrameType(render_frame()),
......@@ -433,10 +433,9 @@ void NetErrorHelper::LoadErrorPage(const std::string& html,
failed_url, true /* replace_current_item */);
}
void NetErrorHelper::EnablePageHelperFunctions() {
SecurityInterstitialPageController::Install(
render_frame(),
weak_security_interstitial_controller_delegate_factory_.GetWeakPtr());
void NetErrorHelper::EnablePageHelperFunctions(net::Error net_error) {
SSLCertificateErrorPageController::Install(
render_frame(), weak_ssl_error_controller_delegate_factory_.GetWeakPtr());
NetErrorPageController::Install(
render_frame(), weak_controller_delegate_factory_.GetWeakPtr());
......
......@@ -18,7 +18,7 @@
#include "chrome/common/supervised_user_commands.mojom.h"
#include "chrome/renderer/net/net_error_helper_core.h"
#include "chrome/renderer/net/net_error_page_controller.h"
#include "chrome/renderer/security_interstitials/security_interstitial_page_controller.h"
#include "chrome/renderer/ssl/ssl_certificate_error_page_controller.h"
#include "chrome/renderer/supervised_user/supervised_user_error_page_controller.h"
#include "chrome/renderer/supervised_user/supervised_user_error_page_controller_delegate.h"
#include "components/error_page/common/net_error_info.h"
......@@ -55,7 +55,7 @@ class NetErrorHelper
public content::RenderThreadObserver,
public NetErrorHelperCore::Delegate,
public NetErrorPageController::Delegate,
public SecurityInterstitialPageController::Delegate,
public SSLCertificateErrorPageController::Delegate,
public SupervisedUserErrorPageControllerDelegate,
public chrome::mojom::NetworkDiagnosticsClient,
public chrome::mojom::NavigationCorrector {
......@@ -75,7 +75,7 @@ class NetErrorHelper
void UpdateEasterEggHighScore(int high_score) override;
void ResetEasterEggHighScore() override;
// SecurityInterstitialPageController::Delegate implementation
// SSLCertificateErrorPageController::Delegate implementation
void SendCommand(
security_interstitials::SecurityInterstitialCommand command) override;
......@@ -130,7 +130,7 @@ class NetErrorHelper
bool* auto_fetch_allowed,
std::string* html) const override;
void LoadErrorPage(const std::string& html, const GURL& failed_url) override;
void EnablePageHelperFunctions() override;
void EnablePageHelperFunctions(net::Error net_error) override;
void UpdateErrorPage(const error_page::Error& error,
bool is_failed_post,
bool can_use_local_diagnostics_service) override;
......@@ -207,8 +207,8 @@ class NetErrorHelper
base::WeakPtrFactory<NetErrorPageController::Delegate>
weak_controller_delegate_factory_;
base::WeakPtrFactory<SecurityInterstitialPageController::Delegate>
weak_security_interstitial_controller_delegate_factory_;
base::WeakPtrFactory<SSLCertificateErrorPageController::Delegate>
weak_ssl_error_controller_delegate_factory_;
base::WeakPtrFactory<SupervisedUserErrorPageControllerDelegate>
weak_supervised_user_error_controller_delegate_factory_;
......
......@@ -680,7 +680,8 @@ void NetErrorHelperCore::OnFinishLoad(FrameType frame_type) {
delegate_->SetIsShowingDownloadButton(
committed_error_page_info_->download_button_in_page);
delegate_->EnablePageHelperFunctions();
delegate_->EnablePageHelperFunctions(
static_cast<net::Error>(committed_error_page_info_->error.reason()));
#if defined(OS_ANDROID)
if (committed_error_page_info_->offline_content_feature_state ==
......
......@@ -80,7 +80,7 @@ class NetErrorHelperCore {
// Create extra Javascript bindings in the error page. Will only be invoked
// after an error page has finished loading.
virtual void EnablePageHelperFunctions() = 0;
virtual void EnablePageHelperFunctions(net::Error net_error) = 0;
// Updates the currently displayed error page with a new error code. The
// currently displayed error page must have finished loading, and must have
......
......@@ -390,7 +390,7 @@ class NetErrorHelperCoreTest : public testing::Test,
last_error_html_ = html;
}
void EnablePageHelperFunctions() override {
void EnablePageHelperFunctions(net::Error net_error) override {
enable_page_helper_functions_count_++;
}
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/renderer/security_interstitials/security_interstitial_page_controller.h"
#include "chrome/renderer/ssl/ssl_certificate_error_page_controller.h"
#include "components/security_interstitials/core/controller_client.h"
#include "content/public/renderer/render_frame.h"
......@@ -11,12 +11,12 @@
#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/public/web/web_local_frame.h"
gin::WrapperInfo SecurityInterstitialPageController::kWrapperInfo = {
gin::WrapperInfo SSLCertificateErrorPageController::kWrapperInfo = {
gin::kEmbedderNativeGin};
SecurityInterstitialPageController::Delegate::~Delegate() {}
SSLCertificateErrorPageController::Delegate::~Delegate() {}
void SecurityInterstitialPageController::Install(
void SSLCertificateErrorPageController::Install(
content::RenderFrame* render_frame,
base::WeakPtr<Delegate> delegate) {
v8::Isolate* isolate = blink::MainThreadIsolate();
......@@ -28,9 +28,8 @@ void SecurityInterstitialPageController::Install(
v8::Context::Scope context_scope(context);
gin::Handle<SecurityInterstitialPageController> controller =
gin::CreateHandle(isolate,
new SecurityInterstitialPageController(delegate));
gin::Handle<SSLCertificateErrorPageController> controller = gin::CreateHandle(
isolate, new SSLCertificateErrorPageController(delegate));
if (controller.IsEmpty())
return;
......@@ -39,76 +38,76 @@ void SecurityInterstitialPageController::Install(
controller.ToV8());
}
SecurityInterstitialPageController::SecurityInterstitialPageController(
SSLCertificateErrorPageController::SSLCertificateErrorPageController(
base::WeakPtr<Delegate> delegate)
: delegate_(delegate) {}
SecurityInterstitialPageController::~SecurityInterstitialPageController() {}
SSLCertificateErrorPageController::~SSLCertificateErrorPageController() {}
void SecurityInterstitialPageController::DontProceed() {
void SSLCertificateErrorPageController::DontProceed() {
SendCommand(
security_interstitials::SecurityInterstitialCommand::CMD_DONT_PROCEED);
}
void SecurityInterstitialPageController::Proceed() {
void SSLCertificateErrorPageController::Proceed() {
SendCommand(security_interstitials::SecurityInterstitialCommand::CMD_PROCEED);
}
void SecurityInterstitialPageController::ShowMoreSection() {
void SSLCertificateErrorPageController::ShowMoreSection() {
SendCommand(security_interstitials::SecurityInterstitialCommand::
CMD_SHOW_MORE_SECTION);
}
void SecurityInterstitialPageController::OpenHelpCenter() {
void SSLCertificateErrorPageController::OpenHelpCenter() {
SendCommand(security_interstitials::SecurityInterstitialCommand::
CMD_OPEN_HELP_CENTER);
}
void SecurityInterstitialPageController::OpenDiagnostic() {
void SSLCertificateErrorPageController::OpenDiagnostic() {
SendCommand(
security_interstitials::SecurityInterstitialCommand::CMD_OPEN_DIAGNOSTIC);
}
void SecurityInterstitialPageController::Reload() {
void SSLCertificateErrorPageController::Reload() {
SendCommand(security_interstitials::SecurityInterstitialCommand::CMD_RELOAD);
}
void SecurityInterstitialPageController::OpenDateSettings() {
void SSLCertificateErrorPageController::OpenDateSettings() {
SendCommand(security_interstitials::SecurityInterstitialCommand::
CMD_OPEN_DATE_SETTINGS);
}
void SecurityInterstitialPageController::OpenLogin() {
void SSLCertificateErrorPageController::OpenLogin() {
SendCommand(
security_interstitials::SecurityInterstitialCommand::CMD_OPEN_LOGIN);
}
void SecurityInterstitialPageController::DoReport() {
void SSLCertificateErrorPageController::DoReport() {
SendCommand(
security_interstitials::SecurityInterstitialCommand::CMD_DO_REPORT);
}
void SecurityInterstitialPageController::DontReport() {
void SSLCertificateErrorPageController::DontReport() {
SendCommand(
security_interstitials::SecurityInterstitialCommand::CMD_DONT_REPORT);
}
void SecurityInterstitialPageController::OpenReportingPrivacy() {
void SSLCertificateErrorPageController::OpenReportingPrivacy() {
SendCommand(security_interstitials::SecurityInterstitialCommand::
CMD_OPEN_REPORTING_PRIVACY);
}
void SecurityInterstitialPageController::OpenWhitepaper() {
void SSLCertificateErrorPageController::OpenWhitepaper() {
SendCommand(
security_interstitials::SecurityInterstitialCommand::CMD_OPEN_WHITEPAPER);
}
void SecurityInterstitialPageController::ReportPhishingError() {
void SSLCertificateErrorPageController::ReportPhishingError() {
SendCommand(security_interstitials::SecurityInterstitialCommand::
CMD_REPORT_PHISHING_ERROR);
}
void SecurityInterstitialPageController::SendCommand(
void SSLCertificateErrorPageController::SendCommand(
security_interstitials::SecurityInterstitialCommand command) {
if (delegate_) {
delegate_->SendCommand(command);
......@@ -116,31 +115,30 @@ void SecurityInterstitialPageController::SendCommand(
}
gin::ObjectTemplateBuilder
SecurityInterstitialPageController::GetObjectTemplateBuilder(
SSLCertificateErrorPageController::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<SecurityInterstitialPageController>::
return gin::Wrappable<SSLCertificateErrorPageController>::
GetObjectTemplateBuilder(isolate)
.SetMethod("dontProceed",
&SecurityInterstitialPageController::DontProceed)
.SetMethod("proceed", &SecurityInterstitialPageController::Proceed)
&SSLCertificateErrorPageController::DontProceed)
.SetMethod("proceed", &SSLCertificateErrorPageController::Proceed)
.SetMethod("showMoreSection",
&SecurityInterstitialPageController::ShowMoreSection)
&SSLCertificateErrorPageController::ShowMoreSection)
.SetMethod("openHelpCenter",
&SecurityInterstitialPageController::OpenHelpCenter)
&SSLCertificateErrorPageController::OpenHelpCenter)
.SetMethod("openDiagnostic",
&SecurityInterstitialPageController::OpenDiagnostic)
.SetMethod("reload", &SecurityInterstitialPageController::Reload)
&SSLCertificateErrorPageController::OpenDiagnostic)
.SetMethod("reload", &SSLCertificateErrorPageController::Reload)
.SetMethod("openDateSettings",
&SecurityInterstitialPageController::OpenDateSettings)
.SetMethod("openLogin",
&SecurityInterstitialPageController::OpenLogin)
.SetMethod("doReport", &SecurityInterstitialPageController::DoReport)
&SSLCertificateErrorPageController::OpenDateSettings)
.SetMethod("openLogin", &SSLCertificateErrorPageController::OpenLogin)
.SetMethod("doReport", &SSLCertificateErrorPageController::DoReport)
.SetMethod("dontReport",
&SecurityInterstitialPageController::DontReport)
&SSLCertificateErrorPageController::DontReport)
.SetMethod("openReportingPrivacy",
&SecurityInterstitialPageController::OpenReportingPrivacy)
&SSLCertificateErrorPageController::OpenReportingPrivacy)
.SetMethod("openWhitepaper",
&SecurityInterstitialPageController::OpenWhitepaper)
&SSLCertificateErrorPageController::OpenWhitepaper)
.SetMethod("reportPhishingError",
&SecurityInterstitialPageController::ReportPhishingError);
&SSLCertificateErrorPageController::ReportPhishingError);
}
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_RENDERER_SECURITY_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_CONTROLLER_H_
#define CHROME_RENDERER_SECURITY_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_CONTROLLER_H_
#ifndef CHROME_RENDERER_SSL_SSL_CERTIFICATE_ERROR_PAGE_CONTROLLER_H_
#define CHROME_RENDERER_SSL_SSL_CERTIFICATE_ERROR_PAGE_CONTROLLER_H_
#include "base/memory/weak_ptr.h"
#include "components/security_interstitials/core/controller_client.h"
......@@ -16,8 +16,8 @@ class RenderFrame;
// This class makes various helper functions available to interstitials
// when committed interstitials are on. It is bound to the JavaScript
// window.certificateErrorPageController object.
class SecurityInterstitialPageController
: public gin::Wrappable<SecurityInterstitialPageController> {
class SSLCertificateErrorPageController
: public gin::Wrappable<SSLCertificateErrorPageController> {
public:
static gin::WrapperInfo kWrapperInfo;
......@@ -40,8 +40,8 @@ class SecurityInterstitialPageController
base::WeakPtr<Delegate> delegate);
private:
explicit SecurityInterstitialPageController(base::WeakPtr<Delegate> delegate);
~SecurityInterstitialPageController() override;
explicit SSLCertificateErrorPageController(base::WeakPtr<Delegate> delegate);
~SSLCertificateErrorPageController() override;
void DontProceed();
void Proceed();
......@@ -65,7 +65,7 @@ class SecurityInterstitialPageController
base::WeakPtr<Delegate> const delegate_;
DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPageController);
DISALLOW_COPY_AND_ASSIGN(SSLCertificateErrorPageController);
};
#endif // CHROME_RENDERER_SECURITY_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_CONTROLLER_H_
#endif // CHROME_RENDERER_SSL_SSL_CERTIFICATE_ERROR_PAGE_CONTROLLER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment