From c18663aa171c6cdf03da3e8c70df8663645b97c4 Mon Sep 17 00:00:00 2001 From: Pranjal Date: Mon, 1 Oct 2018 18:56:46 -0700 Subject: [PATCH] Issue: 15232 AllowScript should use atom::ContentSettingsManager like other Allow* methods in the observer --- .../chrome/renderer/content_settings_observer.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/chromium_src/chrome/renderer/content_settings_observer.cc b/chromium_src/chrome/renderer/content_settings_observer.cc index b573152200..7c5b289e4d 100644 --- a/chromium_src/chrome/renderer/content_settings_observer.cc +++ b/chromium_src/chrome/renderer/content_settings_observer.cc @@ -432,11 +432,13 @@ bool ContentSettingsObserver::AllowScript(bool enabled_per_settings) { // IsWhitelistedForContentSettings(); if there is only the default rule // allowing all scripts, it's quicker this way. bool allow = true; - if (content_setting_rules_) { - ContentSetting setting = GetContentSettingFromRules( - content_setting_rules_->script_rules, frame, - url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL()); - allow = setting != CONTENT_SETTING_BLOCK; + if (content_settings_manager_->content_settings()) { + allow = + content_settings_manager_->GetSetting( + ContentSettingsManager::GetOriginOrURL(render_frame()->GetWebFrame()), + url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL(), + "javascript", + allow) != CONTENT_SETTING_BLOCK; } allow = allow || IsWhitelistedForContentSettings();