Bug 1382637 - Zombify tabs in onDestroy to ensure video/audio recording ends when Fennec is swipe-to-killed. r=snorp
authorDylan Roeh <droeh@mozilla.com>
Wed, 23 Jan 2019 11:41:01 -0600
changeset 515159 03609832ffdcdbeac6703dfc7933419b20ad1fad
parent 515158 3c3a040d5e3f5f5b4382110ee6a7394470c82ae5
child 515160 483fa314e45e0cc19039c69726068ab8b8d37cec
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1382637
milestone66.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 1382637 - Zombify tabs in onDestroy to ensure video/audio recording ends when Fennec is swipe-to-killed. r=snorp
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -1544,16 +1544,18 @@ public class BrowserApp extends GeckoApp
             delegate.onDestroy(this);
         }
 
         deleteTempFiles(getApplicationContext());
 
         NotificationHelper.destroy();
         GeckoNetworkManager.destroy();
 
+        EventDispatcher.getInstance().dispatch("Browser:ZombifyTabs", null);
+
         MmaDelegate.flushResources(this);
 
         super.onDestroy();
     }
 
     @Override
     protected void initializeChrome() {
         super.initializeChrome();
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -366,16 +366,17 @@ var BrowserApp = {
       "Tab:Move",
       "Tab:OpenUri",
       "Tab:ViewSource",
     ]);
 
     GlobalEventDispatcher.registerListener(this, [
       "Browser:LoadManifest",
       "Browser:Quit",
+      "Browser:ZombifyTabs",
       "Fonts:Reload",
       "FormHistory:Init",
       "FullScreen:Exit",
       "Locale:OS",
       "Locale:Changed",
       "Passwords:Init",
       "Sanitize:ClearData",
       "SaveAs:PDF",
@@ -1725,16 +1726,23 @@ var BrowserApp = {
         installManifest(browser, data);
         break;
       }
 
       case "Browser:Quit":
         this.quit(data);
         break;
 
+      case "Browser:ZombifyTabs":
+        let tabs = this._tabs;
+        for (let i = 0; i < tabs.length; i++) {
+          tabs[i].zombify();
+        }
+        break;
+
       case "Fonts:Reload":
         FontEnumerator.updateFontList();
         break;
 
       case "FormHistory:Init": {
         // Force creation/upgrade of formhistory.sqlite
         FormHistory.count({}, {
           handleCompletion() {