[Pkg-mozext-commits] [tabmixplus] 06/34: [e10s] Remove unsafe use of CPOWs, follow up bug 1097998 - [e10s] Warn when using CPOWs when content process isn't in a safe state

David Prévot taffit at moszumanska.debian.org
Mon Mar 9 23:28:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit f1b628e5b08a55b36f65e28d039e04d9e8c4ccf8
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Feb 22 15:02:23 2015 +0200

    [e10s] Remove unsafe use of CPOWs, follow up bug 1097998 - [e10s] Warn when using CPOWs when content process isn't in a safe state
---
 chrome/content/content.js         | 20 ++++++++++++++++----
 chrome/content/session/session.js |  3 ++-
 chrome/content/tab/tab.js         | 26 ++++++++++++++++----------
 3 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/chrome/content/content.js b/chrome/content/content.js
index 77b2b9f..1419739 100644
--- a/chrome/content/content.js
+++ b/chrome/content/content.js
@@ -23,6 +23,8 @@ let TabmixContentHandler = {
   MESSAGES: [
     "Tabmix:restorePermissions",
     "Tabmix:collectPermissions",
+    "Tabmix:resetContentName",
+    "Tabmix:sendDOMTitleChanged"
   ],
 
   init: function () {
@@ -42,11 +44,21 @@ let TabmixContentHandler = {
           disallow: data.disallow,
           reload: data.reload
         });
-      break;
+        break;
       case "Tabmix:collectPermissions":
-      let caps = DocShellCapabilities.collect(docShell).join(",");
-      sendSyncMessage("Tabmix:collectPermissionsComplete", {caps: caps});
-      break;
+        let caps = DocShellCapabilities.collect(docShell).join(",");
+        sendSyncMessage("Tabmix:collectPermissionsComplete", {caps: caps});
+        break;
+      case "Tabmix:resetContentName":
+        if (content.name)
+          content.name = "";
+        break;
+      case "Tabmix:sendDOMTitleChanged":
+        // workaround for bug 1081891
+        let title = content.document.title;
+        if (title)
+          sendAsyncMessage("DOMTitleChanged", { title: title });
+        break;
     }
   },
 
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 74e0626..9db037f 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -2759,7 +2759,8 @@ try{
       var aBrowser = gBrowser.getBrowserForTab(aTab);
       if (gBrowser.isBlankBrowser(aBrowser)) return;
       var bContent = aBrowser[TabmixSvc.contentWindowAsCPOW];
-      this.setLiteral(this.getNodeForTab(aTab), "scroll", bContent.scrollX + "," + bContent.scrollY);
+      if (bContent)
+        this.setLiteral(this.getNodeForTab(aTab), "scroll", bContent.scrollX + "," + bContent.scrollY);
    },
 
    tabSelected: function(needFlush) {
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index ba333ae..79b0a96 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -2501,7 +2501,8 @@ var TabmixProgressListener = {
       '$&'
     ).toCode();
     this.listener.mTabBrowser = tabBrowser;
-    if (!Tabmix.isVersion(340))
+    // Bug 1081891 fixed on Firefox 38
+    if (!Tabmix.isVersion(340) || Tabmix.isVersion(380))
       this.listener._fixTabTitle = function() {};
     tabBrowser.addTabsProgressListener(this.listener);
   },
@@ -2510,17 +2511,18 @@ var TabmixProgressListener = {
     mTabBrowser: null,
     showProgressOnTab: false,
 
-    _fixTabTitle: function TMP__contentLinkClick(tab, browser) {
-      if (browser.getAttribute("remote") != "true" ||
+    // Bug 1081891: Calling webNavigation.loadURI with url that trigger
+    // unknownContentType.xul dialog change the tab title to its address
+    // as a workaround we trigger DOMTitleChanged async message
+    _fixTabTitle: function TMP__contentLinkClick(tab, browser, url) {
+      if (browser.getAttribute("remote") != "true" || /^about/.test(url) ||
           browser._contentTitle !== "" || this.mTabBrowser.isBlankTab(tab))
         return;
       tab.addEventListener("TabLabelModified", function titleChanged(event) {
         tab.removeEventListener("TabLabelModified", titleChanged, true);
-        let title = browser.contentDocumentAsCPOW.title;
-        if (browser._contentTitle != title) {
+        if (!browser._contentTitle) {
           event.preventDefault();
-          browser._contentTitle = title;
-          tab.visibleLabel = title;
+          browser.messageManager.sendAsyncMessage("Tabmix:sendDOMTitleChanged");
         }
       }, true);
     },
@@ -2546,7 +2548,7 @@ var TabmixProgressListener = {
       if (aStateFlags & nsIWebProgressListener.STATE_START &&
           aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
         let url = aRequest.QueryInterface(Ci.nsIChannel).URI.spec;
-        this._fixTabTitle(tab, aBrowser);
+        this._fixTabTitle(tab, aBrowser, url);
         if (url == "about:blank") {
           tab.removeAttribute("busy");
           tab.removeAttribute("progress");
@@ -2618,8 +2620,12 @@ var TabmixProgressListener = {
           Tabmix.autoReload.onTabReloaded(tab, aBrowser);
 
         // disabled name for locked tab, so locked tab don't get reuse
-        if (tab.getAttribute("locked") && aBrowser[TabmixSvc.contentWindowAsCPOW].name)
-          aBrowser[TabmixSvc.contentWindowAsCPOW].name = "";
+        if (tab.getAttribute("locked")) {
+          if (Tabmix.isVersion(320))
+            aBrowser.messageManager.sendAsyncMessage("Tabmix:resetContentName");
+          else if (aBrowser.contentWindow.name)
+            aBrowser.contentWindow.name = "";
+        }
       }
     }
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list