Commit 2ec822d3 authored by Carlos IL's avatar Carlos IL Committed by Commit Bot

Added SB committed interstitials flag.

Added SB committed interstitials flag, and changed the cancellation
error code to ERR_BLOCKED_BY_CLIENT if the flag is set.

Bug: 910794
Change-Id: I43853600bee91f7fdeea78409248994372fd7091
Reviewed-on: https://chromium-review.googlesource.com/c/1364330
Commit-Queue: Carlos IL <carlosil@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615782}
parent 7faa5f11
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
#include "components/safe_browsing/browser/browser_url_loader_throttle.h" #include "components/safe_browsing/browser/browser_url_loader_throttle.h"
#include "base/feature_list.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "components/safe_browsing/browser/safe_browsing_url_checker_impl.h" #include "components/safe_browsing/browser/safe_browsing_url_checker_impl.h"
#include "components/safe_browsing/browser/url_checker_delegate.h" #include "components/safe_browsing/browser/url_checker_delegate.h"
#include "components/safe_browsing/common/safebrowsing_constants.h" #include "components/safe_browsing/common/safebrowsing_constants.h"
#include "components/safe_browsing/common/utils.h" #include "components/safe_browsing/common/utils.h"
#include "components/safe_browsing/features.h"
#include "net/log/net_log_event_type.h" #include "net/log/net_log_event_type.h"
#include "net/url_request/redirect_info.h" #include "net/url_request/redirect_info.h"
#include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_request.h"
...@@ -144,7 +146,10 @@ void BrowserURLLoaderThrottle::OnCompleteCheck(bool slow_check, ...@@ -144,7 +146,10 @@ void BrowserURLLoaderThrottle::OnCompleteCheck(bool slow_check,
url_checker_.reset(); url_checker_.reset();
pending_checks_ = 0; pending_checks_ = 0;
pending_slow_checks_ = 0; pending_slow_checks_ = 0;
delegate_->CancelWithError(net::ERR_ABORTED, delegate_->CancelWithError(
base::FeatureList::IsEnabled(kCommittedSBInterstitials)
? net::ERR_BLOCKED_BY_CLIENT
: net::ERR_ABORTED,
kCustomCancelReasonForURLLoader); kCustomCancelReasonForURLLoader);
} }
} }
......
...@@ -36,6 +36,9 @@ const base::Feature kCheckByURLLoaderThrottle{ ...@@ -36,6 +36,9 @@ const base::Feature kCheckByURLLoaderThrottle{
"S13nSafeBrowsingCheckByURLLoaderThrottle", "S13nSafeBrowsingCheckByURLLoaderThrottle",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kCommittedSBInterstitials{
"SafeBrowsingCommittedInterstitials", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kForceEnableResetPasswordWebUI{ const base::Feature kForceEnableResetPasswordWebUI{
"ForceEnableResetPasswordWebUI", base::FEATURE_DISABLED_BY_DEFAULT}; "ForceEnableResetPasswordWebUI", base::FEATURE_DISABLED_BY_DEFAULT};
...@@ -67,6 +70,7 @@ constexpr struct { ...@@ -67,6 +70,7 @@ constexpr struct {
{&kAdSamplerTriggerFeature, false}, {&kAdSamplerTriggerFeature, false},
{&kBillingInterstitial, true}, {&kBillingInterstitial, true},
{&kCheckByURLLoaderThrottle, true}, {&kCheckByURLLoaderThrottle, true},
{&kCommittedSBInterstitials, true},
{&kForceEnableResetPasswordWebUI, true}, {&kForceEnableResetPasswordWebUI, true},
{&kSuspiciousSiteTriggerQuotaFeature, true}, {&kSuspiciousSiteTriggerQuotaFeature, true},
{&kThreatDomDetailsTagAndAttributeFeature, false}, {&kThreatDomDetailsTagAndAttributeFeature, false},
......
...@@ -26,6 +26,10 @@ extern const base::Feature kBillingInterstitial; ...@@ -26,6 +26,10 @@ extern const base::Feature kBillingInterstitial;
extern const base::Feature kCheckByURLLoaderThrottle; extern const base::Feature kCheckByURLLoaderThrottle;
// Controls if safe browsing interstitials are implemented as committed
// navigations instead of overlays.
extern const base::Feature kCommittedSBInterstitials;
// Forces the chrome://reset-password page to be shown for review or testing // Forces the chrome://reset-password page to be shown for review or testing
// purpose. // purpose.
extern const base::Feature kForceEnableResetPasswordWebUI; extern const base::Feature kForceEnableResetPasswordWebUI;
......
...@@ -32,6 +32,7 @@ source_set("throttles") { ...@@ -32,6 +32,7 @@ source_set("throttles") {
deps = [ deps = [
"//base:base", "//base:base",
"//components/safe_browsing:features",
"//components/safe_browsing/common:common", "//components/safe_browsing/common:common",
"//components/safe_browsing/common:interfaces", "//components/safe_browsing/common:interfaces",
"//content/public/common:common", "//content/public/common:common",
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
#include "components/safe_browsing/renderer/renderer_url_loader_throttle.h" #include "components/safe_browsing/renderer/renderer_url_loader_throttle.h"
#include "base/feature_list.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "components/safe_browsing/common/safebrowsing_constants.h" #include "components/safe_browsing/common/safebrowsing_constants.h"
#include "components/safe_browsing/common/utils.h" #include "components/safe_browsing/common/utils.h"
#include "components/safe_browsing/features.h"
#include "mojo/public/cpp/bindings/interface_request.h" #include "mojo/public/cpp/bindings/interface_request.h"
#include "net/url_request/redirect_info.h" #include "net/url_request/redirect_info.h"
#include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_request.h"
...@@ -184,7 +186,10 @@ void RendererURLLoaderThrottle::OnCompleteCheckInternal( ...@@ -184,7 +186,10 @@ void RendererURLLoaderThrottle::OnCompleteCheckInternal(
notifier_bindings_.reset(); notifier_bindings_.reset();
pending_checks_ = 0; pending_checks_ = 0;
pending_slow_checks_ = 0; pending_slow_checks_ = 0;
delegate_->CancelWithError(net::ERR_ABORTED, delegate_->CancelWithError(
base::FeatureList::IsEnabled(kCommittedSBInterstitials)
? net::ERR_BLOCKED_BY_CLIENT
: net::ERR_ABORTED,
kCustomCancelReasonForURLLoader); kCustomCancelReasonForURLLoader);
} }
} }
......
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