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

Issue 1431963002: Don't allow main world initialization while creating the initial empty document

Created:
5 years, 1 month ago by Devlin
Modified:
5 years, 1 month ago
Reviewers:
haraken, Nate Chapin, dcheng
CC:
chromium-reviews, blink-reviews, blink-reviews-bindings_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't allow main world initialization while creating the initial empty document In addition to possibly causing problems in blink, this seems to be responsible for an extensions bug where script contexts would be mis-classified (because the context was created before the url was set). BUG=340382

Patch Set 1 #

Patch Set 2 : #

Messages

Total messages: 12 (4 generated)
Devlin
haraken@, mind taking a look at the blink change? The CL description and bug have ...
5 years, 1 month ago (2015-11-09 19:49:01 UTC) #4
haraken
On 2015/11/09 19:49:01, Devlin wrote: > haraken@, mind taking a look at the blink change? ...
5 years, 1 month ago (2015-11-09 20:03:28 UTC) #5
Devlin
On 2015/11/09 20:03:28, haraken wrote: > On 2015/11/09 19:49:01, Devlin wrote: > > haraken@, mind ...
5 years, 1 month ago (2015-11-09 21:02:24 UTC) #6
haraken
On 2015/11/09 21:02:24, Devlin wrote: > On 2015/11/09 20:03:28, haraken wrote: > > On 2015/11/09 ...
5 years, 1 month ago (2015-11-09 22:47:11 UTC) #7
Devlin
On 2015/11/09 22:47:11, haraken wrote: > On 2015/11/09 21:02:24, Devlin wrote: > > On 2015/11/09 ...
5 years, 1 month ago (2015-11-09 22:49:35 UTC) #8
haraken
+dcheng
5 years, 1 month ago (2015-11-09 22:50:43 UTC) #10
Nate Chapin
On 2015/11/09 22:49:35, Devlin wrote: > On 2015/11/09 22:47:11, haraken wrote: > > On 2015/11/09 ...
5 years, 1 month ago (2015-11-09 22:51:17 UTC) #11
dcheng
5 years, 1 month ago (2015-11-10 00:25:51 UTC) #12
On 2015/11/09 at 22:51:17, japhet wrote:
> On 2015/11/09 22:49:35, Devlin wrote:
> > On 2015/11/09 22:47:11, haraken wrote:
> > > On 2015/11/09 21:02:24, Devlin wrote:
> > > > On 2015/11/09 20:03:28, haraken wrote:
> > > > > On 2015/11/09 19:49:01, Devlin wrote:
> > > > > > haraken@, mind taking a look at the blink change?  The CL
description
> > and
> > > > bug
> > > > > > have some background, but basically extensions code was freaking out
> > > because
> > > > > we
> > > > > > got a didCreateScriptContext notification without an associated url.

> > The
> > > > > > blink-side change was the recommendation of japhet@, and fixes it.
> > > > > 
> > > > > Actually I'm not quite sure if this is a right fix. The current Blink
is
> > > > > assuming that ScriptController::initializeMainWorld unconditionally
> > > > initializes
> > > > > the main world if it's not yet initialized. This CL is going to break
the
> > > > > assumption.
> > > > 
> > > > Okay.  Can you think of an alternative way to ensure that when
> > > > didCreateScriptContext is called there is an associated URL (or an
> > alternative
> > > > for accessing the url during that notification, or something to wait for
> > > > following that)?
> > > 
> > > I'm not familiar with extensions, but it seems that you need to implement
a
> > way
> > > to get an url when the url becomes available. It seems that
> > > didCreateScriptContext is too early to get the url.
> > 
> > I'm unfamiliar with blink innards (together, we have all the answers! ;)). 
Is
> > there a WebFrame notification that corresponds with the url becoming
available?
> 
> didCommitProvisionalLoad is approximately that.

At some point, I think we need to figure out how all these different
WebFrameClient callbacks (didCommitProvisionalLoad, didClearWindowObject,
didCreateScriptContext, didCreateDocumentElement, didCreateNewDocument,
didHandleOnloadEvents, didFinishLoad, etc) interact, how they're ordered, etc.

And try to eliminate some. There's way too many, and it makes this sort of thing
really hard to reason about.

Powered by Google App Engine
This is Rietveld 408576698