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

Issue 791763003: [DISCARD] While getting plug-in info, use securityOrigin() of the top level frame (Closed)

Created:
6 years ago by lazyboy
Modified:
5 years, 1 month ago
Reviewers:
Charlie Reis, alexmos
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

** THIS CL DOESN'T FIX THE ISSUE ** While getting plug-in info, use securityOrigin() of the top level frame instead of trying to access top level frame document's url(). If the top level frame in the renderer/ is a RemoteFrame, it does not have a document() and trying to fetch document().url() would result in crash. We need top level frame's "origin url" only for getting plug-in info anyway. Open questions: a. The top origin url param in ChromeViewHostMsg_GetPluginInfo can be changed to be of type base::string16 instead of GURL. b. What happens if one of the call to frame->top()->securityOrigin().isNull() == true? Is that possible? BUG=426658 Test=with --site-per-process flag, see following scenarios work w/o crashing renderer (terminal shouldn't see any SEGV_MAPPERR while accessing blink::WebDocument::url()): 1) Load a page that has a plugin and make sure you have that plugin enabled. e.g. http://a.tommycli.com/layout1_iframe_leiz.html Observe the plugin load correctly. 2) Disable the plugin from chrome://plugins, Observe that there is not renderer crash stacktrace. 3) Load a page with a plugin that is disabled or change your chrome://settings chrome://settings/content so that you have "Click to play" selected under "Plug-ins" section. This will trigger a "plug-in placeholder" thing. Observe the plugin placeholder load correctly.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -5 lines) Patch
M chrome/renderer/chrome_content_renderer_client.cc View 1 chunk +8 lines, -1 line 0 comments Download
M chrome/renderer/plugins/chrome_plugin_placeholder.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/renderer/plugins/shadow_dom_plugin_placeholder.cc View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 11 (2 generated)
lazyboy
Adding some notes: lazyboy@osmium:/ssd/wblink2/src$ git gs "\bChromeViewHostMsg_GetPluginInfo\b" chrome/browser/plugins/plugin_info_message_filter.cc:207: IPC_MESSAGE_HANDLER_DELAY_REPLY(ChromeViewHostMsg_GetPluginInfo, chrome/browser/plugins/plugin_info_message_filter.cc:277: ChromeViewHostMsg_GetPluginInfo::WriteReplyParams(reply_msg, output); chrome/common/render_messages.h:100:// Output parameters ...
6 years ago (2014-12-09 22:17:27 UTC) #1
lazyboy
+Charlie for taking a look. See the CL description and comment #1 first for issues ...
6 years ago (2014-12-09 22:20:41 UTC) #3
Charlie Reis
[+alexmos] > Open questions: > a. The top origin url param in ChromeViewHostMsg_GetPluginInfo can be ...
6 years ago (2014-12-09 23:36:11 UTC) #4
Charlie Reis
Actually +alexmos this time.
6 years ago (2014-12-09 23:42:32 UTC) #6
alexmos
On 2014/12/09 23:36:11, Charlie Reis wrote: > [+alexmos] > > > Open questions: > > ...
6 years ago (2014-12-10 00:36:08 UTC) #7
lazyboy
On 2014/12/10 00:36:08, alexmos wrote: > On 2014/12/09 23:36:11, Charlie Reis wrote: > > [+alexmos] ...
6 years ago (2014-12-12 02:15:35 UTC) #8
Charlie Reis
On 2014/12/12 02:15:35, lazyboy wrote: > On 2014/12/10 00:36:08, alexmos wrote: > > On 2014/12/09 ...
6 years ago (2014-12-12 18:29:12 UTC) #9
alexmos
On 2014/12/12 18:29:12, Charlie Reis wrote: > On 2014/12/12 02:15:35, lazyboy wrote: > > On ...
6 years ago (2014-12-12 20:19:52 UTC) #10
Charlie Reis
6 years ago (2014-12-12 20:28:29 UTC) #11
On 2014/12/12 20:19:52, alexmos wrote:
> Just wondering -- it seems that in this case the renderer doesn't actually use
> the top frame's URL for anything other than passing it to the browser process.

> Could we retrieve the top frame's URL on the browser side, from
> PluginInfoMessageFilter::OnGetPluginInfo, rather than sending it in the
message?
>  For example, could OnGetPluginInfo get the RenderFrameHost that's receiving
the
> message, walk the tree using GetParent(), and then use GetLastCommittedURL()?

I would love to get the data from the browser process-- that would be far
preferable, since the renderer could lie about it.  The catch here is that we're
on the IO thread in this code, and there's a TOCTOU issue with hopping over to
the UI thread to find out the last committed URL.

It may still be worthwhile to route the message to RenderFrameHost to begin
with, grab the last committed URL, and then post a task to the IO thread to
complete the rest of the work.  It's a bit slower, but that would give us data
we could trust.

Powered by Google App Engine
This is Rietveld 408576698