Two calls to WindowProxy::initialize for every iframe |
|||||
Issue descriptionGoogle Chrome 54.0.2820.2 (Official Build) canary (64-bit) Revision eeda2a63b39ea71b74ec5497d8400ff7e81377c0-refs/branch-heads/2820@{#2} OS Mac OS X What steps will reproduce the problem? (1) Go to http://pr.gg (2) Open devtools console. (3) Open tracing and record all things under Manual. (4) document.body.innerHTML = "<iframe></iframe>".repeat(500); Looking at the trace I see two calls to ::initialize() for every iframe.
,
Aug 10 2016
peria-san: Would you take a look at this?
,
Aug 10 2016
This looks like it might be extensions, does creating the isolated world involve calling that twice?
,
Aug 10 2016
Ah, that's plausible. Yes, WindowProxy::initialize needs to be called per window (i.e., per isolated world).
,
Aug 10 2016
I tried it on some environment, and it reproduced only on Google corp machines' Chrome. Newly built Chromium on the same machine does not reproduce it.
Arguments of ParseHTML events, that are the parents of the second WindowProxy::initialize(), are
beginData : {frame: "0x39c7014424f8", startLine: 0, url: "about:blank"}
endData : {endLine: -1}
Do they mean that some extensions/apps try to open "about:blank" in iframes?
,
Aug 10 2016
Extensions need to opt in to loading in about:blank I think? A clean build of Chrome wouldn't have any extensions so it wouldn't show this. You should be able to copy PasswordAlert out of Chrome and use the "Load unpacked extension" mode in chrome://extensions to see this. We definitely need to figure out how to make all of this faster. Does every extension result in another call to WindowProxy::initialize for the new isolated world? If that's true it means extensions are crazy expensive at the iframe level.
,
Aug 10 2016
WindowProxy::initialize is called lazily. I guess your extension is proactively running a content script that accesses window in some way. Then we cannot avoid instantiating the WindowProxy.
,
Aug 25 2016
,
Nov 4 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8607ed4014092c8fea4db5a35cea0cf3fd96dd03 commit 8607ed4014092c8fea4db5a35cea0cf3fd96dd03 Author: peria <peria@chromium.org> Date: Fri Nov 04 07:33:23 2016 Expose a function messageHanlderInMainThread in V8Initializer.cpp as a static method of V8Initializer to be visible from other compile units. This function will be referred from V8 in its context serialization. BUG= 636159 Review-Url: https://codereview.chromium.org/2480583003 Cr-Commit-Position: refs/heads/master@{#429825} [modify] https://crrev.com/8607ed4014092c8fea4db5a35cea0cf3fd96dd03/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp [modify] https://crrev.com/8607ed4014092c8fea4db5a35cea0cf3fd96dd03/third_party/WebKit/Source/bindings/core/v8/V8Initializer.h
,
Nov 6 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 9 2017
peria@, is this something we can address? If #7 is true (i.e. only limited extensions create their contexts proactively and most extensions do not), then this might not be a big problem. Does the initialization happen on all extensions or limited extensions?
,
Nov 10 2017
,
Nov 10 2017
According to #6, an extension PasswordAlert creates a context on every iframe, and it makes sense. So I think we have nothing to do to reduce the number of calls. Let me close as WontFix. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by haraken@chromium.org
, Aug 10 2016