Bug 1539210 - Do not destroy the content process session on page unload. r=ato
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 04 Apr 2019 11:29:29 +0000
changeset 467979 d0558202539c2f1f0977b332b8ea65472039a77c
parent 467978 dea69b276a3ff4dd609e73eed9222fae154091e6
child 467980 dfc8060c8b0ef0b0efd89c2b437bfda5f23f8d69
push id112667
push useraiakab@mozilla.com
push dateThu, 04 Apr 2019 16:12:45 +0000
treeherdermozilla-inbound@230bb363f2f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1539210
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1539210 - Do not destroy the content process session on page unload. r=ato A session is bound to a browsing context, not just one document. `unload` is fired when navigating to another document. The document goes away, but not the browsing context. So, we should keep the session up and running when the current document is destroyed and we navigate to another URL. Depends on D25577 Differential Revision: https://phabricator.services.mozilla.com/D25578
remote/sessions/ContentProcessSession.jsm
--- a/remote/sessions/ContentProcessSession.jsm
+++ b/remote/sessions/ContentProcessSession.jsm
@@ -14,23 +14,19 @@ class ContentProcessSession {
     this.messageManager = messageManager;
     this.browsingContext = browsingContext;
     this.content = content;
     this.docShell = docShell;
 
     this.domains = new Domains(this, ContentProcessDomains);
     this.messageManager.addMessageListener("remote:request", this);
     this.messageManager.addMessageListener("remote:destroy", this);
-
-    this.destroy = this.destroy.bind(this);
-    this.content.addEventListener("unload", this.destroy);
   }
 
   destroy() {
-    this.content.addEventListener("unload", this.destroy);
     this.messageManager.removeMessageListener("remote:request", this);
     this.messageManager.removeMessageListener("remote:destroy", this);
   }
 
   // Domain event listener
 
   onEvent(eventName, params) {
     this.messageManager.sendAsyncMessage("remote:event", {