Commit a37c7008 authored by Daniel Vogelheim's avatar Daniel Vogelheim Committed by Commit Bot

Origin Policy: Enable w/ --enable-experimental-web-platform-features.

(Follow-up to cl 1165351.)

Bug: 751996
Change-Id: I37b57e239dced37fc5390d5db4b42cdc8be7466d
Reviewed-on: https://chromium-review.googlesource.com/1177607
Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589138}
parent f17b2cd3
......@@ -37,7 +37,12 @@ bool OriginPolicyThrottle::ShouldRequestOriginPolicy(
const GURL& url,
std::string* request_version) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!base::FeatureList::IsEnabled(features::kOriginPolicy))
bool origin_policy_enabled =
base::FeatureList::IsEnabled(features::kOriginPolicy) ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableExperimentalWebPlatformFeatures);
if (!origin_policy_enabled)
return false;
if (!url.SchemeIs(url::kHttpsScheme))
......@@ -64,7 +69,11 @@ OriginPolicyThrottle::MaybeCreateThrottleFor(NavigationHandle* handle) {
net::HttpRequestHeaders::kSecOriginPolicy))
return nullptr;
DCHECK(base::FeatureList::IsEnabled(features::kOriginPolicy));
// TODO(vogelheim): Rewrite & hoist up this DCHECK to ensure that ..HasHeader
// and ShouldRequestOriginPolicy are always equal on entry to the method.
// This depends on https://crbug.com/881234 being fixed.
DCHECK(OriginPolicyThrottle::ShouldRequestOriginPolicy(handle->GetURL(),
nullptr));
return base::WrapUnique(new OriginPolicyThrottle(handle));
}
......
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