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

Issue 1550233002: Move mixed content settings histograms into browser (Closed)

Created:
4 years, 12 months ago by estark
Modified:
4 years, 11 months ago
Reviewers:
Mike West, alexmos
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, msramek+watch_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, tyoshino+watch_chromium.org, raymes+watch_chromium.org, blink-reviews-api_chromium.org, blink-reviews, dglazkov+blink, darin-cc_chromium.org, gavinp+loader_chromium.org, mkwst+moarreviews-renderer_chromium.org, markusheintz_, Nate Chapin, loading-reviews_chromium.org, site-isolation-reviews_chromium.org, Charlie Reis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move mixed content settings histograms into browser This CL moves the content settings histograms for mixed content into the browser, called via a separate FrameClient method from the existing FrameLoaderClient::allowDisplayingInsecureContent/allowRunningInsecureContent methods. The purpose of doing this is to make mixed content checks work with OOPIFs. The histograms require knowledge of the full URL of a possibly remote frame, whereas checking whether the content is allowed can be done from the local frame client. Thus, this CL separates out the histogram logic (and makes it available on a RemoteFrameClient) from the content settings check (which is always done on the LocalFrame that loaded the mixed content, since the content settings for mixed content are always applied per WebContents). BUG=486936

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : typo fix #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+354 lines, -185 lines) Patch
M chrome/browser/content_settings/tab_specific_content_settings.h View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/content_settings/tab_specific_content_settings.cc View 3 chunks +187 lines, -0 lines 4 comments Download
M chrome/renderer/content_settings_observer.cc View 4 chunks +0 lines, -184 lines 1 comment Download
M content/browser/frame_host/render_frame_host_delegate.h View 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 1 chunk +3 lines, -0 lines 1 comment Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 chunks +14 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.cc View 2 chunks +16 lines, -0 lines 1 comment Download
M content/browser/web_contents/web_contents_impl.h View 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 1 chunk +13 lines, -0 lines 0 comments Download
M content/common/frame_messages.h View 1 1 chunk +8 lines, -0 lines 1 comment Download
M content/public/browser/web_contents_observer.h View 1 chunk +7 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 1 chunk +14 lines, -0 lines 1 comment Download
M content/renderer/render_frame_proxy.h View 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameClient.h View 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/EmptyClients.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/MixedContentChecker.cpp View 4 chunks +6 lines, -1 line 3 comments Download
M third_party/WebKit/Source/web/FrameLoaderClientImpl.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp View 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/RemoteFrameClientImpl.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebFrameClient.h View 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebRemoteFrameClient.h View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
estark
mkwst, alexmos: could you take a look at this rough-draft CL and its follow-up https://codereview.chromium.org/1550723003/? ...
4 years, 11 months ago (2016-01-07 20:09:21 UTC) #2
alexmos
Thanks! Overall, this approach looks reasonable to me, and moving histographs over seems like a ...
4 years, 11 months ago (2016-01-09 01:39:02 UTC) #4
Charlie Reis
https://codereview.chromium.org/1550233002/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/1550233002/diff/40001/chrome/browser/content_settings/tab_specific_content_settings.cc#newcode879 chrome/browser/content_settings/tab_specific_content_settings.cc:879: DCHECK_EQ(frame_gurl.host(), origin_host); On 2016/01/09 01:39:02, alexmos wrote: > Hmm, ...
4 years, 11 months ago (2016-01-12 18:10:47 UTC) #5
estark
4 years, 11 months ago (2016-01-12 18:55:23 UTC) #6
On 2016/01/12 18:10:47, Charlie Reis wrote:
>
https://codereview.chromium.org/1550233002/diff/40001/chrome/browser/content_...
> File chrome/browser/content_settings/tab_specific_content_settings.cc (right):
> 
>
https://codereview.chromium.org/1550233002/diff/40001/chrome/browser/content_...
> chrome/browser/content_settings/tab_specific_content_settings.cc:879:
> DCHECK_EQ(frame_gurl.host(), origin_host);
> On 2016/01/09 01:39:02, alexmos wrote:
> > Hmm, I'm thinking there may be a race here, where the top frame is
navigating
> to
> > a new URL in parallel to mixed content occurring.  In that case,
> > GetLastCommittedURL might return the new URL, whereas the origin from the
> > renderer is old and thus may not match.  
> > 
> > Charlie, I know you know about many such races - is such a situation
possible?
> 
> > The context here is A-embed-B, B has a mixed image, and B sends up an IPC to
> A's
> > RFPH, which ends up here (rfh is for A) to record histograms.
> 
> Yes, this race is possible.  See the documentation for both
GetLastCommittedURL
> and GetLastCommittedOrigin on RenderFrameHost-- those methods are confusing
> because they actually return the FrameTreeNode's current RenderFrameHost's
> URL/origin, even when you call them on a different RenderFrameHost (e.g., one
> that has just been replaced during a cross-process navigation).  We're looking
> at ways to improve them, but it's tricky since FrameTreeNode isn't exposed
> publicly.
> 
> Here, you could receive this OnTriedDisplayingInsecureContent IPC from a RFH
> that was just replaced by a new RFH, and both the last committed URL and
origin
> would be from the new RFH.

Gotcha, thanks for the explanation. I started a thread with Enamel to see what
these histograms are currently used for, if anything. I suspect that the
raciness might not be of huge importance, or even that the histogram values that
depend on the current URL of the frame might not even be of interest anymore.

> 
> > 
> > Also, couldn't we just get the origin on the browser side as well, rather
than
> > passing it from the renderer?  We now have
> > RenderFrameHost::GetLastCommittedOrigin.  This would at least make the
origin
> > and URL consistent, though possibly out of sync with the renderer due to
race
> > above, but maybe that's ok for histograms?   This also wouldn't let the
> renderer
> > lie about the origin.
> > 
> > All that said, I think the DCHECK is still problematic, because the origin
and
> > URL may be inconsistent in certain scenarios (e.g., when origin is inherited
> > from parent for about:blank).

Powered by Google App Engine
This is Rietveld 408576698