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

Issue 2048303002: Fix broken mixed script Rappor metric and add browser test (Closed)

Created:
4 years, 6 months ago by estark
Modified:
4 years, 5 months ago
Reviewers:
felt, raymes, sky, Jialiu Lin
CC:
chromium-reviews, markusheintz_, msramek+watch_chromium.org, raymes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix broken mixed script Rappor metric and add browser test This metric has not been recording meaningful data because of a mistake while passing the mixed script hostname across the IPC boundary. We had been passing a hostname and passing that into a GURL constructor to pass into Rappor, but GURL expects a valid URL, including both scheme and hostname, and returns an empty URL otherwise. So this change passes the full origin (as a string), which correctly gets turned into a valid GURL. Fix is based on a patch started by jialiul@ at https://codereview.chromium.org/1424933014/ BUG=536975, 536981

Patch Set 1 #

Total comments: 5

Patch Set 2 : felt comments #

Patch Set 3 : make BlockAllContentForTesting() uphold the details-is-a-valid-GURL contract #

Total comments: 6

Patch Set 4 : add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -13 lines) Patch
M chrome/browser/content_settings/chrome_content_settings_utils.h View 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/content_settings/chrome_content_settings_utils.cc View 3 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/content_settings/content_settings_browsertest.cc View 3 chunks +57 lines, -0 lines 0 comments Download
M chrome/browser/content_settings/tab_specific_content_settings.h View 3 chunks +10 lines, -0 lines 0 comments Download
M chrome/browser/content_settings/tab_specific_content_settings.cc View 1 2 6 chunks +21 lines, -6 lines 0 comments Download
M chrome/browser/ui/content_settings/content_setting_bubble_model.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/renderer/content_settings_observer.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/renderer/content_settings_observer.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 20 (5 generated)
estark
raymes: can you please review chrome/browser/content_settings? felt: can you please review chrome/browser/ui/content_settings? lgarron, jialiul: could ...
4 years, 6 months ago (2016-06-09 06:37:26 UTC) #3
lgarron
On 2016/06/09 at 06:37:26, estark wrote: > raymes: can you please review chrome/browser/content_settings? > felt: ...
4 years, 6 months ago (2016-06-09 23:39:43 UTC) #4
felt
lgtm https://codereview.chromium.org/2048303002/diff/1/chrome/browser/content_settings/tab_specific_content_settings.cc File chrome/browser/content_settings/tab_specific_content_settings.cc (left): https://codereview.chromium.org/2048303002/diff/1/chrome/browser/content_settings/tab_specific_content_settings.cc#oldcode847 chrome/browser/content_settings/tab_specific_content_settings.cc:847: nit: why kill this line break? https://codereview.chromium.org/2048303002/diff/1/chrome/browser/content_settings/tab_specific_content_settings.cc File ...
4 years, 6 months ago (2016-06-10 03:41:08 UTC) #5
estark
https://codereview.chromium.org/2048303002/diff/1/chrome/browser/content_settings/tab_specific_content_settings.cc File chrome/browser/content_settings/tab_specific_content_settings.cc (left): https://codereview.chromium.org/2048303002/diff/1/chrome/browser/content_settings/tab_specific_content_settings.cc#oldcode847 chrome/browser/content_settings/tab_specific_content_settings.cc:847: On 2016/06/10 03:41:08, felt wrote: > nit: why kill ...
4 years, 6 months ago (2016-06-10 03:55:20 UTC) #6
estark
friendly ping to raymes https://codereview.chromium.org/2048303002/diff/40001/chrome/browser/content_settings/tab_specific_content_settings.cc File chrome/browser/content_settings/tab_specific_content_settings.cc (right): https://codereview.chromium.org/2048303002/diff/40001/chrome/browser/content_settings/tab_specific_content_settings.cc#newcode849 chrome/browser/content_settings/tab_specific_content_settings.cc:849: OnContentBlockedWithDetail(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, note: an alternative could ...
4 years, 6 months ago (2016-06-12 17:12:16 UTC) #8
raymes
lgtm
4 years, 6 months ago (2016-06-13 22:10:44 UTC) #9
estark
sky@ can you please review chrome/renderer/content_settings_observer.cc?
4 years, 6 months ago (2016-06-13 22:13:05 UTC) #11
estark
friendly ping to sky
4 years, 6 months ago (2016-06-15 19:33:31 UTC) #12
sky
https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc File chrome/renderer/content_settings_observer.cc (right): https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc#newcode486 chrome/renderer/content_settings_observer.cc:486: DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString()); I'm not familiar with this code, so ...
4 years, 6 months ago (2016-06-16 16:22:47 UTC) #13
estark
https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc File chrome/renderer/content_settings_observer.cc (right): https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc#newcode486 chrome/renderer/content_settings_observer.cc:486: DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString()); On 2016/06/16 16:22:47, sky wrote: > I'm ...
4 years, 6 months ago (2016-06-16 16:56:58 UTC) #14
sky
https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc File chrome/renderer/content_settings_observer.cc (right): https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc#newcode486 chrome/renderer/content_settings_observer.cc:486: DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString()); On 2016/06/16 16:56:58, estark wrote: > On ...
4 years, 6 months ago (2016-06-16 17:42:50 UTC) #15
estark
https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc File chrome/renderer/content_settings_observer.cc (right): https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc#newcode486 chrome/renderer/content_settings_observer.cc:486: DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString()); On 2016/06/16 17:42:49, sky wrote: > On ...
4 years, 6 months ago (2016-06-16 18:29:23 UTC) #16
Jialiu Lin
https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc File chrome/renderer/content_settings_observer.cc (right): https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc#newcode486 chrome/renderer/content_settings_observer.cc:486: DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString()); On 2016/06/16 at 18:29:23, estark wrote: > ...
4 years, 6 months ago (2016-06-16 20:47:17 UTC) #18
estark
On 2016/06/16 20:47:17, Jialiu Lin wrote: > https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc > File chrome/renderer/content_settings_observer.cc (right): > > https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content_settings_observer.cc#newcode486 ...
4 years, 6 months ago (2016-06-16 22:38:09 UTC) #19
Jialiu Lin
4 years, 6 months ago (2016-06-20 20:25:57 UTC) #20
On 2016/06/16 at 22:38:09, estark wrote:
> On 2016/06/16 20:47:17, Jialiu Lin wrote:
> >
https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content...
> > File chrome/renderer/content_settings_observer.cc (right):
> > 
> >
https://codereview.chromium.org/2048303002/diff/40001/chrome/renderer/content...
> > chrome/renderer/content_settings_observer.cc:486:
> > DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString());
> > On 2016/06/16 at 18:29:23, estark wrote:
> > > On 2016/06/16 17:42:49, sky wrote:
> > > > On 2016/06/16 16:56:58, estark wrote:
> > > > > On 2016/06/16 16:22:47, sky wrote:
> > > > > > I'm not familiar with this code, so why is toString better than
host? A
> > > > > comment
> > > > > > would help. What is the expectation for the argument supplied to
> > > > > > DidBlockContentType? A comment in the header would be helpful.
> > > > > 
> > > > > The browser-side IPC handler expects |details| to be a valid GURL for
this
> > > > > content type (and a hostname is not a valid GURL). Added comments.
> > > > 
> > > > Can DidBlockContentType take a GURL then? Also, it's my understanding
> > toString()
> > > > may not return a url. It returns something 'like' a url. For if the
> > > > websecurityorigin is empty toString() returns 'null'. How do you know
you
> > won't
> > > > hit that code path?
> > > 
> > > Ah, that's a good point. It appears that this could indeed be empty if the
> > origin is, for example, sandboxed. My understanding, also, is that this
string
> > argument is a generic details argument that can't simply be changed to a
GURL.
> > (Other content settings type send other string values in the |details|
argument,
> > IIUC.)
> > > 
> > > I don't think I can spend any more time on this. lgarron and/or jialiul,
since
> > you did the original metric + fix, are either of you interested in taking
this
> > over, now that there's a test for it?
> > > 
> > > Otherwise I think we should just revert the commit that introduced this
metric
> > until someone has time to fix it properly.
> > 
> > Here is the CL originally introduced this rappor metric.
> > https://codereview.chromium.org/1162123002
> > If nobody is actually consuming this rappor metric, I agree with estark that
we
> > probably should simply revert it.
> 
> That looks like a different one, actually. That's
"ContentSettings.MixedScript.RanMixedScript", whereas this is
"ContentSettings.MixedScript.DisplayedShield".
My bad. It was actually added by lgarron@ in
https://codereview.chromium.org/1148773005

Powered by Google App Engine
This is Rietveld 408576698