Commit acbe77cc authored by Joshua Bell's avatar Joshua Bell Committed by Commit Bot

Remove unused params from WebContentSettingsClient methods (#2)

None of the AllowRunningInsecureContent overrides use the "origin"
param, so remove it. The renderer shouldn't be trusted anyway.

Bug: 1019772
Change-Id: Idb9f062a9d4c319537c02fbdda47acd55a2b4b47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894478Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712826}
parent 15c05111
......@@ -35,7 +35,6 @@ AwContentSettingsClient::~AwContentSettingsClient() {
bool AwContentSettingsClient::AllowRunningInsecureContent(
bool enabled_per_settings,
const blink::WebSecurityOrigin& origin,
const blink::WebURL& url) {
return enabled_per_settings ? true : AllowMixedContent(url);
}
......
......@@ -25,7 +25,6 @@ class AwContentSettingsClient : public content::RenderFrameObserver,
// blink::WebContentSettingsClient implementation.
bool AllowRunningInsecureContent(bool enabled_per_settings,
const blink::WebSecurityOrigin& origin,
const blink::WebURL& url) override;
DISALLOW_COPY_AND_ASSIGN(AwContentSettingsClient);
......
......@@ -429,7 +429,6 @@ bool ContentSettingsAgentImpl::AllowMutationEvents(bool default_value) {
bool ContentSettingsAgentImpl::AllowRunningInsecureContent(
bool allowed_per_settings,
const blink::WebSecurityOrigin& origin,
const blink::WebURL& resource_url) {
bool allow = allowed_per_settings;
......
......@@ -94,7 +94,6 @@ class ContentSettingsAgentImpl
void DidNotAllowPlugins() override;
void DidNotAllowScript() override;
bool AllowRunningInsecureContent(bool allowed_per_settings,
const blink::WebSecurityOrigin& context,
const blink::WebURL& url) override;
bool AllowAutoplay(bool default_value) override;
bool AllowPopupsAndRedirects(bool default_value) override;
......
......@@ -72,7 +72,6 @@ bool WorkerContentSettingsClient::AllowCacheStorage() {
bool WorkerContentSettingsClient::AllowRunningInsecureContent(
bool allowed_per_settings,
const blink::WebSecurityOrigin& context,
const blink::WebURL& url) {
if (!allow_running_insecure_content_ && !allowed_per_settings) {
EnsureContentSettingsManager();
......
......@@ -33,7 +33,6 @@ class WorkerContentSettingsClient : public blink::WebContentSettingsClient {
bool AllowIndexedDB() override;
bool AllowCacheStorage() override;
bool AllowRunningInsecureContent(bool allowed_per_settings,
const blink::WebSecurityOrigin& context,
const blink::WebURL& url) override;
bool AllowScriptFromSource(bool enabled_per_settings,
const blink::WebURL& script_url) override;
......
......@@ -53,7 +53,6 @@ bool MockContentSettingsClient::AllowStorage(bool enabled_per_settings) {
bool MockContentSettingsClient::AllowRunningInsecureContent(
bool enabled_per_settings,
const blink::WebSecurityOrigin& context,
const blink::WebURL& url) {
return enabled_per_settings || flags_->running_insecure_content_allowed();
}
......
......@@ -34,7 +34,6 @@ class MockContentSettingsClient : public blink::WebContentSettingsClient {
const blink::WebURL& script_url) override;
bool AllowStorage(bool local) override;
bool AllowRunningInsecureContent(bool enabled_per_settings,
const blink::WebSecurityOrigin& context,
const blink::WebURL& url) override;
bool AllowAutoplay(bool default_value) override;
void PersistClientHints(
......
......@@ -14,7 +14,6 @@
namespace blink {
class WebSecurityOrigin;
class WebURL;
// This class provides the content settings information which tells
......@@ -67,7 +66,6 @@ class WebContentSettingsClient {
// Controls whether insecure scripts are allowed to execute for this frame.
virtual bool AllowRunningInsecureContent(bool enabled_per_settings,
const WebSecurityOrigin&,
const WebURL&) {
return enabled_per_settings;
}
......
......@@ -448,7 +448,7 @@ bool MixedContentChecker::ShouldBlockFetch(
allowed = settings && settings->GetAllowRunningOfInsecureContent();
if (content_settings_client) {
allowed = content_settings_client->AllowRunningInsecureContent(
allowed, WebSecurityOrigin(security_origin), url);
allowed, url);
}
}
if (allowed) {
......@@ -522,8 +522,7 @@ bool MixedContentChecker::ShouldBlockFetchOnWorker(
settings->GetAllowRunningOfInsecureContent());
allowed = should_ask_embedder &&
worker_fetch_context.AllowRunningInsecureContent(
settings->GetAllowRunningOfInsecureContent(),
fetch_client_settings_object.GetSecurityOrigin(), url);
settings->GetAllowRunningOfInsecureContent(), url);
if (allowed) {
worker_fetch_context.GetWebWorkerFetchContext()->DidRunInsecureContent(
WebSecurityOrigin(fetch_client_settings_object.GetSecurityOrigin()),
......@@ -581,8 +580,8 @@ bool MixedContentChecker::IsWebSocketAllowed(
bool allowed = IsWebSocketAllowedInFrame(frame_fetch_context,
security_context, settings, url);
if (content_settings_client) {
allowed = content_settings_client->AllowRunningInsecureContent(
allowed, WebSecurityOrigin(security_origin), url);
allowed =
content_settings_client->AllowRunningInsecureContent(allowed, url);
}
if (allowed)
......@@ -611,8 +610,7 @@ bool MixedContentChecker::IsWebSocketAllowed(
bool allowed =
IsWebSocketAllowedInWorker(worker_fetch_context, settings, url);
allowed = worker_fetch_context.AllowRunningInsecureContent(
allowed, security_origin, url);
allowed = worker_fetch_context.AllowRunningInsecureContent(allowed, url);
if (allowed) {
worker_fetch_context.GetWebWorkerFetchContext()->DidRunInsecureContent(
......
......@@ -257,12 +257,11 @@ WorkerSettings* WorkerFetchContext::GetWorkerSettings() const {
bool WorkerFetchContext::AllowRunningInsecureContent(
bool enabled_per_settings,
const SecurityOrigin* origin,
const KURL& url) const {
if (!global_scope_->ContentSettingsClient())
return enabled_per_settings;
return global_scope_->ContentSettingsClient()->AllowRunningInsecureContent(
enabled_per_settings, WebSecurityOrigin(origin), url);
enabled_per_settings, url);
}
void WorkerFetchContext::Trace(blink::Visitor* visitor) {
......
......@@ -89,7 +89,6 @@ class WorkerFetchContext final : public BaseFetchContext {
}
bool AllowRunningInsecureContent(bool enabled_per_settings,
const SecurityOrigin* origin,
const KURL& url) const;
void Trace(blink::Visitor*) override;
......
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