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