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

Issue 2740873005: ExtensionFrameHelper shouldn't trigger initialization of the main world (Closed)

Created:
3 years, 9 months ago by dcheng
Modified:
3 years, 9 months ago
Reviewers:
haraken, Devlin, Yuki
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Yuki, Alexander Semashko, nhiroki
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ExtensionFrameHelper shouldn't trigger initialization of the main world DidCreateScriptContext() compares the context argument to the main world script context. However, getting the main world script context will initialize its WindowProxy, which can corrupt internal state when swapping frames. BUG=700077 Review-Url: https://codereview.chromium.org/2740873005 Cr-Commit-Position: refs/heads/master@{#455975} Committed: https://chromium.googlesource.com/chromium/src/+/128ef2d7248bd291e08ddfa30c8444dc26abc9b8

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -3 lines) Patch
M extensions/renderer/extension_frame_helper.cc View 2 chunks +4 lines, -3 lines 2 comments Download

Messages

Total messages: 23 (11 generated)
dcheng
3 years, 9 months ago (2017-03-09 22:34:09 UTC) #2
Devlin
this patch lgtm, but I'm worried this might not be a complete fix. It does ...
3 years, 9 months ago (2017-03-10 02:59:39 UTC) #7
dcheng
On 2017/03/10 02:59:39, Devlin wrote: > this patch lgtm, but I'm worried this might not ...
3 years, 9 months ago (2017-03-10 03:02:52 UTC) #9
dcheng
On 2017/03/10 03:02:52, dcheng wrote: > On 2017/03/10 02:59:39, Devlin wrote: > > this patch ...
3 years, 9 months ago (2017-03-10 03:03:11 UTC) #10
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/2740873005/1
3 years, 9 months ago (2017-03-10 03:03:48 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/128ef2d7248bd291e08ddfa30c8444dc26abc9b8
3 years, 9 months ago (2017-03-10 03:10:31 UTC) #15
Yuki
+cc: nhiroki@ FYI. This CL itself LGTM. https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extension_frame_helper.cc File extensions/renderer/extension_frame_helper.cc (right): https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extension_frame_helper.cc#newcode30 extensions/renderer/extension_frame_helper.cc:30: constexpr int ...
3 years, 9 months ago (2017-03-10 07:34:46 UTC) #17
haraken
https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extension_frame_helper.cc File extensions/renderer/extension_frame_helper.cc (right): https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extension_frame_helper.cc#newcode30 extensions/renderer/extension_frame_helper.cc:30: constexpr int kMainWorldId = 0; On 2017/03/10 07:34:46, Yuki ...
3 years, 9 months ago (2017-03-10 09:17:26 UTC) #19
dcheng
On 2017/03/10 09:17:26, haraken wrote: > https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extension_frame_helper.cc > File extensions/renderer/extension_frame_helper.cc (right): > > https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extension_frame_helper.cc#newcode30 > ...
3 years, 9 months ago (2017-03-10 09:23:33 UTC) #20
haraken
On 2017/03/10 09:23:33, dcheng wrote: > On 2017/03/10 09:17:26, haraken wrote: > > > https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extension_frame_helper.cc ...
3 years, 9 months ago (2017-03-10 09:26:30 UTC) #21
Devlin
On 2017/03/10 09:26:30, haraken wrote: > On 2017/03/10 09:23:33, dcheng wrote: > > On 2017/03/10 ...
3 years, 9 months ago (2017-03-10 15:54:26 UTC) #22
haraken
3 years, 9 months ago (2017-03-10 19:18:24 UTC) #23
Message was sent while issue was closed.
On 2017/03/10 15:54:26, Devlin wrote:
> On 2017/03/10 09:26:30, haraken wrote:
> > On 2017/03/10 09:23:33, dcheng wrote:
> > > On 2017/03/10 09:17:26, haraken wrote:
> > > >
> > >
> >
>
https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extensi...
> > > > File extensions/renderer/extension_frame_helper.cc (right):
> > > > 
> > > >
> > >
> >
>
https://codereview.chromium.org/2740873005/diff/1/extensions/renderer/extensi...
> > > > extensions/renderer/extension_frame_helper.cc:30: constexpr int
> kMainWorldId
> > =
> > > > 0;
> > > > On 2017/03/10 07:34:46, Yuki wrote:
> > > > > side note: Probably, we should get rid of exposing world IDs.
> > > > > +nhiroki@ FYI.
> > > > 
> > > > Yeah, agreed. Ideally I want to entirely remove world IDs from the
> embedder
> > > > side.
> > > > 
> > > > Alternately can we expose some public API like isMainWorld()?
> > > 
> > > Unless we want to wrap v8::Context in a Blink wrapper object, I think it'd
> be
> > > easiest to pass down whether or not it's the main world as an argument to
> the
> > > WebFrameClient callbacks.
> > 
> > Agreed.
> 
> Note that extensions use world ids for more than just the main world; they
also
> rely on them to be able to inject scripts into a consistent (per-extension)
> isolated world (using requestExecuteScriptInIsolatedWorld).

Yeah, so this CL is just making the situation a bit worse. So LGTM.

Ideally I'd like to encapsulate the ID concept inside Blink.

Powered by Google App Engine
This is Rietveld 408576698