Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2053)

Unified Diff: chrome/browser/plugins/chrome_plugin_service_filter.cc

Issue 2378573005: [HBD] Blanket BLOCK on all non-HTTP(s) and non-FILE URLs for Flash. (Closed)
Patch Set: fix dat merge Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/plugins/chrome_plugin_service_filter.cc
diff --git a/chrome/browser/plugins/chrome_plugin_service_filter.cc b/chrome/browser/plugins/chrome_plugin_service_filter.cc
index cf68c8153639c8964cdb5fb9822fdd92358206d8..b2d68f35dc6ebe6f448f880aba61369ec556eacd 100644
--- a/chrome/browser/plugins/chrome_plugin_service_filter.cc
+++ b/chrome/browser/plugins/chrome_plugin_service_filter.cc
@@ -28,7 +28,6 @@
#include "content/public/browser/resource_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_constants.h"
-#include "url/gurl.h"
using content::BrowserThread;
using content::PluginService;
@@ -175,7 +174,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
int render_frame_id,
const void* context,
const GURL& plugin_content_url,
- const GURL& main_url,
+ const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin) {
base::AutoLock auto_lock(lock_);
const ProcessDetails* details = GetProcess(render_process_id);
@@ -212,19 +211,18 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins)) {
// Check the content setting first, and always respect the ALLOW or BLOCK
// state. When IsPluginAvailable() is called to check whether a plugin
- // should be advertised, |plugin_content_url| has the same value of
- // |main_url| (i.e. the main frame origin). The intended behavior is that
- // Flash is advertised only if a Flash embed hosted on the same origin as
- // the main frame origin is allowed to run.
+ // should be advertised, |url| has the same origin as |main_frame_origin|.
+ // The intended behavior is that Flash is advertised only if a Flash embed
+ // hosted on the same origin as the main frame origin is allowed to run.
bool is_managed = false;
HostContentSettingsMap* settings_map =
context_info_it->second->host_content_settings_map.get();
ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting(
- settings_map, main_url, plugin_content_url, &is_managed);
+ settings_map, main_frame_origin, plugin_content_url, &is_managed);
flash_setting = PluginsFieldTrial::EffectiveContentSetting(
CONTENT_SETTINGS_TYPE_PLUGINS, flash_setting);
- double engagement =
- SiteEngagementService::GetScoreFromSettings(settings_map, main_url);
+ double engagement = SiteEngagementService::GetScoreFromSettings(
+ settings_map, main_frame_origin.GetURL());
if (flash_setting == CONTENT_SETTING_ALLOW) {
UMA_HISTOGRAM_COUNTS_100(kEngagementSettingAllowedHistogram, engagement);
« no previous file with comments | « chrome/browser/plugins/chrome_plugin_service_filter.h ('k') | chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698