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

Issue 2285553002: [HBD] Gate the advertising of Flash on Site Engagement. (Closed)

Created:
4 years, 3 months ago by dominickn
Modified:
4 years, 2 months ago
CC:
chromium-reviews, jam, calamity, kcarattini
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[HBD] Gate the advertising of Flash on Site Engagement. When the PreferHtmlOverPlugins feature is active, and the plugins content setting isn't one of ALLOW or BLOCK, each site's engagement score is now consulted to determine whether or not Flash is added to the list of available plugins. The score must be above a certain threshold for Flash to be advertised. The amount of engagement required to activate Flash defaults to 1, which is currently the equivalent of navigating directly to a site via the omnibox, or spending ~1 minute interacting with the site after visiting via a link. This value is controllable via a variations parameter under the PreferHtmlOverPlugins feature. This CL adds a thread-agnostic interface to the site engagement service, which is necessary as ChromePluginServiceFilter::IsPluginAvailable runs exclusively on the IO thread, from which is it not possible to create a SiteEngagementService object. This new interface relies on the fact that the underlying HostContentSettingsMap class methods can be called from any thread. This CL additionally removes the fallback logic from the site engagement service for incognito support, as this is already baked into the underlying HostContentSettingsMap. A minor cleanup of ChromePluginServiceFilter is also undertaken. BUG=626728, 641627, 641630 Committed: https://crrev.com/8583adb8ee4711d11421d53579567bc68eaf4d54 Cr-Commit-Position: refs/heads/master@{#419623}

Patch Set 1 #

Patch Set 2 : Check URL #

Total comments: 5

Patch Set 3 : Thread safety, unit tests. Removing observer #

Patch Set 4 : Incognito support #

Patch Set 5 : Remove dead code #

Patch Set 6 : Tidying #

Total comments: 13

Patch Set 7 : Address comments #

Total comments: 17

Patch Set 8 : Addressing comments #

Total comments: 2

Patch Set 9 : Rebase #

Patch Set 10 : Always respect ALLOW or BLOCK #

Patch Set 11 : Address nits #

Total comments: 12

Patch Set 12 : Address comments #

Total comments: 4

Patch Set 13 : Comments #

Patch Set 14 : Address nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+608 lines, -121 lines) Patch
M chrome/browser/engagement/site_engagement_score.h View 1 2 3 4 5 6 5 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/engagement/site_engagement_score.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +27 lines, -36 lines 0 comments Download
M chrome/browser/engagement/site_engagement_score_unittest.cc View 1 2 4 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/engagement/site_engagement_service.h View 1 2 3 4 5 6 7 8 9 10 5 chunks +30 lines, -11 lines 0 comments Download
M chrome/browser/engagement/site_engagement_service.cc View 1 2 3 4 2 chunks +16 lines, -2 lines 0 comments Download
M chrome/browser/engagement/site_engagement_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +84 lines, -0 lines 0 comments Download
M chrome/browser/plugins/chrome_plugin_service_filter.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -6 lines 0 comments Download
M chrome/browser/plugins/chrome_plugin_service_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +63 lines, -57 lines 0 comments Download
A chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +338 lines, -0 lines 0 comments Download
M chrome/browser/plugins/plugins_field_trial.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/plugins/plugins_field_trial.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +25 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 107 (74 generated)
dominickn
PTAL, thanks!
4 years, 3 months ago (2016-08-26 00:19:06 UTC) #5
dominickn
+cc calamity
4 years, 3 months ago (2016-08-26 00:20:00 UTC) #6
tommycli
dominickn: Thanks for the quick turnaround. Here you are. A unit test would be good ...
4 years, 3 months ago (2016-08-26 17:44:08 UTC) #13
tommycli
one further comment: Since I'm guessing managing multiple FlashEngagementObservers might be non-trivial. It might be ...
4 years, 3 months ago (2016-08-26 20:56:36 UTC) #14
dominickn
Regarding the unit test: There's a lot of machinery here (and there's no existing unit ...
4 years, 3 months ago (2016-08-26 21:48:28 UTC) #15
tommycli
On 2016/08/26 21:48:28, dominickn wrote: > Regarding the unit test: There's a lot of machinery ...
4 years, 3 months ago (2016-08-26 21:53:52 UTC) #16
dominickn
Additionally, this CL is going to get more complicated because I've just realised that IsPluginAvailable ...
4 years, 3 months ago (2016-08-26 21:55:41 UTC) #17
tommycli
On 2016/08/26 21:55:41, dominickn wrote: > Additionally, this CL is going to get more complicated ...
4 years, 3 months ago (2016-08-26 22:04:44 UTC) #18
dominickn
On 2016/08/26 22:04:44, tommycli wrote: > On 2016/08/26 21:55:41, dominickn wrote: > > Additionally, this ...
4 years, 3 months ago (2016-08-29 03:03:24 UTC) #19
chromium-reviews
Yep exactly. The CL to pass the origin from Blink is here. It was a ...
4 years, 3 months ago (2016-08-29 03:26:02 UTC) #20
dominickn
Oh excellent! Assuming that works and lands, that will solve the origin issue. Then all ...
4 years, 3 months ago (2016-08-29 03:32:26 UTC) #21
dominickn
Revamped version: * adds a thread safe interface to site engagement that can be accessed ...
4 years, 3 months ago (2016-09-12 07:24:26 UTC) #32
calamity
https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc File chrome/browser/engagement/site_engagement_score.cc (right): https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc#newcode239 chrome/browser/engagement/site_engagement_score.cc:239: if (!UpdateScoreDict(score_dict_.get()) || !settings_map_) Is the settings_map_ ever null? ...
4 years, 3 months ago (2016-09-13 04:14:37 UTC) #41
dominickn
https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc File chrome/browser/engagement/site_engagement_score.cc (right): https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc#newcode239 chrome/browser/engagement/site_engagement_score.cc:239: if (!UpdateScoreDict(score_dict_.get()) || !settings_map_) On 2016/09/13 04:14:37, calamity wrote: ...
4 years, 3 months ago (2016-09-13 04:42:14 UTC) #44
raymes
https://codereview.chromium.org/2285553002/diff/130001/chrome/browser/plugins/chrome_plugin_service_filter.cc File chrome/browser/plugins/chrome_plugin_service_filter.cc (right): https://codereview.chromium.org/2285553002/diff/130001/chrome/browser/plugins/chrome_plugin_service_filter.cc#newcode209 chrome/browser/plugins/chrome_plugin_service_filter.cc:209: } Hmm I think this might cause non-pepper plugins ...
4 years, 3 months ago (2016-09-13 06:00:04 UTC) #49
dominickn
https://codereview.chromium.org/2285553002/diff/130001/chrome/browser/plugins/chrome_plugin_service_filter.cc File chrome/browser/plugins/chrome_plugin_service_filter.cc (right): https://codereview.chromium.org/2285553002/diff/130001/chrome/browser/plugins/chrome_plugin_service_filter.cc#newcode209 chrome/browser/plugins/chrome_plugin_service_filter.cc:209: } On 2016/09/13 06:00:04, raymes wrote: > Hmm I ...
4 years, 3 months ago (2016-09-13 06:05:24 UTC) #50
calamity
site_engagement lgtm. https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc File chrome/browser/engagement/site_engagement_score.cc (right): https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc#newcode239 chrome/browser/engagement/site_engagement_score.cc:239: if (!UpdateScoreDict(score_dict_.get()) || !settings_map_) On 2016/09/13 04:42:14, ...
4 years, 3 months ago (2016-09-13 06:33:34 UTC) #51
tommycli
dominickn: Awesome, I'm very pumped about the through unit tests you added to ChromePluginServiceFilter. That ...
4 years, 3 months ago (2016-09-13 18:25:04 UTC) #52
dominickn
Thanks! https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc File chrome/browser/engagement/site_engagement_score.cc (right): https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc#newcode239 chrome/browser/engagement/site_engagement_score.cc:239: if (!UpdateScoreDict(score_dict_.get()) || !settings_map_) On 2016/09/13 06:33:34, calamity ...
4 years, 3 months ago (2016-09-14 01:06:56 UTC) #55
tommycli
On 2016/09/14 01:06:56, dominickn wrote: > Thanks! > > https://codereview.chromium.org/2285553002/diff/110001/chrome/browser/engagement/site_engagement_score.cc > File chrome/browser/engagement/site_engagement_score.cc (right): > ...
4 years, 3 months ago (2016-09-14 03:50:14 UTC) #65
tommycli
lgtm very through tests. thank you! https://codereview.chromium.org/2285553002/diff/130001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc File chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc (right): https://codereview.chromium.org/2285553002/diff/130001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc#newcode280 chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc:280: TEST_F(ChromePluginServiceFilterTest, PreferHtmlOverPluginsIncognito) { ...
4 years, 3 months ago (2016-09-14 17:12:38 UTC) #68
dominickn
Thanks! +bauerb: PTAL at chrome/browser/plugins. Thanks! https://codereview.chromium.org/2285553002/diff/150001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc File chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc (right): https://codereview.chromium.org/2285553002/diff/150001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc#newcode64 chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc:64: content::BrowserThread::PostTask( On 2016/09/14 ...
4 years, 3 months ago (2016-09-15 01:16:20 UTC) #72
Bernhard Bauer
https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/engagement/site_engagement_score.cc File chrome/browser/engagement/site_engagement_score.cc (right): https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/engagement/site_engagement_score.cc#newcode50 chrome/browser/engagement/site_engagement_score.cc:50: return base::WrapUnique(static_cast<base::DictionaryValue*>(value.release())); There is now DictionaryValue::From(), which will do ...
4 years, 3 months ago (2016-09-15 09:05:15 UTC) #80
dominickn
Thanks - PTAnL! https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/engagement/site_engagement_score.cc File chrome/browser/engagement/site_engagement_score.cc (right): https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/engagement/site_engagement_score.cc#newcode50 chrome/browser/engagement/site_engagement_score.cc:50: return base::WrapUnique(static_cast<base::DictionaryValue*>(value.release())); On 2016/09/15 09:05:15, Bernhard ...
4 years, 3 months ago (2016-09-15 12:16:00 UTC) #83
Bernhard Bauer
https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc File chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc (right): https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc#newcode52 chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc:52: SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD); On 2016/09/15 12:16:00, dominickn wrote: > On 2016/09/15 ...
4 years, 3 months ago (2016-09-15 15:39:54 UTC) #86
dominickn
https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc File chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc (right): https://codereview.chromium.org/2285553002/diff/230001/chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc#newcode52 chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc:52: SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD); On 2016/09/15 15:39:54, Bernhard Bauer wrote: > On ...
4 years, 3 months ago (2016-09-16 00:26:01 UTC) #89
Bernhard Bauer
https://codereview.chromium.org/2285553002/diff/250001/chrome/browser/engagement/site_engagement_score.cc File chrome/browser/engagement/site_engagement_score.cc (right): https://codereview.chromium.org/2285553002/diff/250001/chrome/browser/engagement/site_engagement_score.cc#newcode48 chrome/browser/engagement/site_engagement_score.cc:48: if (!value.get() || !value->IsType(base::Value::TYPE_DICTIONARY)) On 2016/09/16 00:26:01, dominickn wrote: ...
4 years, 3 months ago (2016-09-16 10:32:38 UTC) #92
dominickn
We've been through a few rounds of nits on this now. Are there any more ...
4 years, 3 months ago (2016-09-19 00:59:56 UTC) #93
Bernhard Bauer
lgtm
4 years, 3 months ago (2016-09-19 08:49:41 UTC) #94
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2285553002/290001
4 years, 3 months ago (2016-09-20 01:16:05 UTC) #101
commit-bot: I haz the power
Committed patchset #14 (id:290001)
4 years, 3 months ago (2016-09-20 01:22:44 UTC) #103
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/8583adb8ee4711d11421d53579567bc68eaf4d54 Cr-Commit-Position: refs/heads/master@{#419623}
4 years, 3 months ago (2016-09-20 01:26:55 UTC) #105
tommycli
4 years, 3 months ago (2016-09-20 22:53:19 UTC) #106
Message was sent while issue was closed.
On 2016/09/20 01:26:55, commit-bot: I haz the power wrote:
> Patchset 14 (id:??) landed as
> https://crrev.com/8583adb8ee4711d11421d53579567bc68eaf4d54
> Cr-Commit-Position: refs/heads/master@{#419623}

Woohoo, thanks for this!

Powered by Google App Engine
This is Rietveld 408576698