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

Issue 1018163002: [Extensions] Skip injecting scripts into remote frames with site isolation turned on. (Closed)

Created:
5 years, 9 months ago by not at google - send to devlin
Modified:
5 years, 9 months ago
Reviewers:
Devlin, nasko
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Skip injecting scripts into remote frames with site isolation turned on. This is admitting defeat by site isolation, for now. It's better than crashing. It will be properly fixed when permission checks are moved into the browser. BUG=454917 R=rdevlin.cronin@chromium.org Committed: https://crrev.com/dfebefe64349581cb675dcdf19861397a28d1252 Cr-Commit-Position: refs/heads/master@{#321254}

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -5 lines) Patch
M extensions/renderer/user_script_set.cc View 1 chunk +12 lines, -5 lines 5 comments Download

Messages

Total messages: 16 (4 generated)
not at google - send to devlin
5 years, 9 months ago (2015-03-18 22:45:03 UTC) #2
Devlin
lgtm. Bummer, but you're right that it's better than just crashing everything. https://codereview.chromium.org/1018163002/diff/1/extensions/renderer/user_script_set.cc File extensions/renderer/user_script_set.cc ...
5 years, 9 months ago (2015-03-18 22:49:31 UTC) #3
Devlin
https://codereview.chromium.org/1018163002/diff/1/extensions/renderer/user_script_set.cc File extensions/renderer/user_script_set.cc (right): https://codereview.chromium.org/1018163002/diff/1/extensions/renderer/user_script_set.cc#newcode208 extensions/renderer/user_script_set.cc:208: blink::WebDocument top_document = web_frame->top()->document(); (I'll defer to nasko that ...
5 years, 9 months ago (2015-03-18 22:50:47 UTC) #4
not at google - send to devlin
https://codereview.chromium.org/1018163002/diff/1/extensions/renderer/user_script_set.cc File extensions/renderer/user_script_set.cc (right): https://codereview.chromium.org/1018163002/diff/1/extensions/renderer/user_script_set.cc#newcode208 extensions/renderer/user_script_set.cc:208: blink::WebDocument top_document = web_frame->top()->document(); On 2015/03/18 22:50:47, Devlin wrote: ...
5 years, 9 months ago (2015-03-18 22:54:54 UTC) #5
not at google - send to devlin
(to reiterate - this will only have an observable effect if --site-per-process is enabled)
5 years, 9 months ago (2015-03-18 22:55:19 UTC) #6
not at google - send to devlin
Moving nasko to CC, he's probably gone home, and I might as well submit this ...
5 years, 9 months ago (2015-03-18 23:09:53 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1018163002/1
5 years, 9 months ago (2015-03-18 23:10:31 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 9 months ago (2015-03-19 00:49:42 UTC) #11
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/dfebefe64349581cb675dcdf19861397a28d1252 Cr-Commit-Position: refs/heads/master@{#321254}
5 years, 9 months ago (2015-03-19 00:50:38 UTC) #12
nasko
Thanks for changing the code to avoid the crashing. I've left a comment with my ...
5 years, 9 months ago (2015-03-19 17:33:48 UTC) #14
not at google - send to devlin
On 2015/03/19 17:33:48, nasko wrote: > Thanks for changing the code to avoid the crashing. ...
5 years, 9 months ago (2015-03-19 17:41:35 UTC) #15
nasko
5 years, 9 months ago (2015-03-19 18:13:04 UTC) #16
Message was sent while issue was closed.
On 2015/03/19 17:41:35, kalman wrote:
> On 2015/03/19 17:33:48, nasko wrote:
> > Thanks for changing the code to avoid the crashing. I've left a comment with
> my
> > thoughts on your discussion.
> > 
> >
>
https://codereview.chromium.org/1018163002/diff/1/extensions/renderer/user_sc...
> > File extensions/renderer/user_script_set.cc (right):
> > 
> >
>
https://codereview.chromium.org/1018163002/diff/1/extensions/renderer/user_sc...
> > extensions/renderer/user_script_set.cc:208: blink::WebDocument top_document
=
> > web_frame->top()->document();
> > On 2015/03/18 22:54:54, kalman wrote:
> > > On 2015/03/18 22:49:31, Devlin wrote:
> > > > nit: This seems like it should be one of the first (if not the first)
> > checks. 
> > > > Why not put it at the start of the method?
> > > 
> > > It's a hack, and the least interesting check here really. Only necessary
> > because
> > > the next line doesn't work without it. No need to draw attention.
> > 
> > Remote frames cannot host any documents or content, therefore it doesn't
make
> > sense to do any script injection for those. The comment above the method
name
> > also mentions this. 
> > 
> > I would've checked if the top() frame is WebRemoteFrame and bailed out early
> in
> > the function. The whole notion of accessing the document is flawed with
remote
> > frames, so this code looks fragile to me.
> 
> So Remote frames turn into Local frames if --site-per-process isn't on, i.e.
> Remote frames can only ever exist with --site-per-process is on?

I'd suggest avoiding thinking whether the flag is present or not. Just think of
WebLocalFrame being a frame as you know it from before, where we have a document
and scripts running. Then think of a WebRemoteFrame as a placeholder that can't
do anything real, but we can ask it about certain properties of it.
Chromium content/ manages the creation of those objects and transforming them
from one object to another.
Where the flag comes is that it is not currently possible to get WebRemoteFrame
for subframes without it.

Powered by Google App Engine
This is Rietveld 408576698