Skip to content

Commit 3c42999

Browse files
author
Iulian Moraru
committed
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)
1 parent cf648b9 commit 3c42999

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

docshell/base/nsDocShell.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9436,7 +9436,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
94369436
// separate check for SHIP so that we know if there are ongoing requests
94379437
// before calling Stop() below.
94389438
if (mozilla::SessionHistoryInParent()) {
9439-
Document* document = GetExtantDocument();
9439+
Document* document = GetDocument();
94409440
uint32_t flags = 0;
94419441
if (document && !document->CanSavePresentation(nullptr, flags, true)) {
94429442
// This forces some flags into the WindowGlobalParent's mBFCacheStatus,

remote/cdp/observers/ContextObserver.sys.mjs

+17-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export class ContextObserver {
3434
this.chromeEventHandler = chromeEventHandler;
3535
lazy.EventEmitter.decorate(this);
3636

37+
this._fissionEnabled = Services.appinfo.fissionAutostart;
38+
3739
this.chromeEventHandler.addEventListener("DOMWindowCreated", this, {
3840
mozSystemGroup: true,
3941
});
@@ -49,7 +51,11 @@ export class ContextObserver {
4951
Services.obs.addObserver(this, "document-element-inserted");
5052
Services.obs.addObserver(this, "inner-window-destroyed");
5153

52-
Services.obs.addObserver(this, "webnavigation-create");
54+
// With Fission disabled the `DOMWindowCreated` event is fired too late.
55+
// Use the `webnavigation-create` notification instead.
56+
if (!this._fissionEnabled) {
57+
Services.obs.addObserver(this, "webnavigation-create");
58+
}
5359
Services.obs.addObserver(this, "webnavigation-destroy");
5460
}
5561

@@ -67,7 +73,9 @@ export class ContextObserver {
6773
Services.obs.removeObserver(this, "document-element-inserted");
6874
Services.obs.removeObserver(this, "inner-window-destroyed");
6975

70-
Services.obs.removeObserver(this, "webnavigation-create");
76+
if (!this._fissionEnabled) {
77+
Services.obs.removeObserver(this, "webnavigation-create");
78+
}
7179
Services.obs.removeObserver(this, "webnavigation-destroy");
7280
}
7381

@@ -83,6 +91,13 @@ export class ContextObserver {
8391
// what ExecutionContext(s) to destroy.
8492
this.emit("context-destroyed", { frameId });
8593

94+
// With Fission enabled the frame is attached early enough so that
95+
// expected network requests and responses are handles afterward.
96+
// Otherwise send the event when `webnavigation-create` is received.
97+
if (this._fissionEnabled) {
98+
this.emit("frame-attached", { frameId, window });
99+
}
100+
86101
break;
87102

88103
case "pageshow":

0 commit comments

Comments
 (0)