forked from mirrors/gecko-dev
Backed out 2 changesets (bug 1875040) for causing performance regression - Bug 1877481. CLOSED TREE
Backed out changeset 8af7503ecb57 (bug 1875040) Backed out changeset 0e77ff8e2bfc (bug 1875040)
This commit is contained in:
parent
cf648b9f1b
commit
3c429990cb
2 changed files with 18 additions and 3 deletions
|
|
@ -9436,7 +9436,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
|
|||
// separate check for SHIP so that we know if there are ongoing requests
|
||||
// before calling Stop() below.
|
||||
if (mozilla::SessionHistoryInParent()) {
|
||||
Document* document = GetExtantDocument();
|
||||
Document* document = GetDocument();
|
||||
uint32_t flags = 0;
|
||||
if (document && !document->CanSavePresentation(nullptr, flags, true)) {
|
||||
// This forces some flags into the WindowGlobalParent's mBFCacheStatus,
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ export class ContextObserver {
|
|||
this.chromeEventHandler = chromeEventHandler;
|
||||
lazy.EventEmitter.decorate(this);
|
||||
|
||||
this._fissionEnabled = Services.appinfo.fissionAutostart;
|
||||
|
||||
this.chromeEventHandler.addEventListener("DOMWindowCreated", this, {
|
||||
mozSystemGroup: true,
|
||||
});
|
||||
|
|
@ -49,7 +51,11 @@ export class ContextObserver {
|
|||
Services.obs.addObserver(this, "document-element-inserted");
|
||||
Services.obs.addObserver(this, "inner-window-destroyed");
|
||||
|
||||
// With Fission disabled the `DOMWindowCreated` event is fired too late.
|
||||
// Use the `webnavigation-create` notification instead.
|
||||
if (!this._fissionEnabled) {
|
||||
Services.obs.addObserver(this, "webnavigation-create");
|
||||
}
|
||||
Services.obs.addObserver(this, "webnavigation-destroy");
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +73,9 @@ export class ContextObserver {
|
|||
Services.obs.removeObserver(this, "document-element-inserted");
|
||||
Services.obs.removeObserver(this, "inner-window-destroyed");
|
||||
|
||||
if (!this._fissionEnabled) {
|
||||
Services.obs.removeObserver(this, "webnavigation-create");
|
||||
}
|
||||
Services.obs.removeObserver(this, "webnavigation-destroy");
|
||||
}
|
||||
|
||||
|
|
@ -83,6 +91,13 @@ export class ContextObserver {
|
|||
// what ExecutionContext(s) to destroy.
|
||||
this.emit("context-destroyed", { frameId });
|
||||
|
||||
// With Fission enabled the frame is attached early enough so that
|
||||
// expected network requests and responses are handles afterward.
|
||||
// Otherwise send the event when `webnavigation-create` is received.
|
||||
if (this._fissionEnabled) {
|
||||
this.emit("frame-attached", { frameId, window });
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "pageshow":
|
||||
|
|
|
|||
Loading…
Reference in a new issue