Bug 1360323 - Implement getTabBrowser shim for lazy browsers. r=dao
authorKevin Jones <kevinhowjones@gmail.com>
Fri, 28 Apr 2017 14:59:10 +0200
changeset 355543 2d9f2486307984ff18dd8f2f9aba96fcf6fc53c0
parent 355542 34f2d83ee7734d23c612039fc5ff364a26b2540c
child 355544 884baa5893d662335aea1fe603d165cf021ccd2f
push id89690
push userdgottwald@mozilla.com
push dateFri, 28 Apr 2017 12:59:29 +0000
treeherdermozilla-inbound@2d9f24863079 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1360323
milestone55.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 1360323 - Implement getTabBrowser shim for lazy browsers. r=dao MozReview-Commit-ID: 5KTJKegwBNG
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2054,16 +2054,44 @@
 
             let names = this._browserBindingProperties;
 
             for (let i = 0; i < names.length; i++) {
               let name = names[i];
               let getter;
               let setter;
               switch (name) {
+                case "audioMuted":
+                  getter = () => {
+                    return false;
+                  };
+                  break;
+                case "contentTitle":
+                  getter = () => {
+                    return SessionStore.getLazyTabValue(aTab, "title");
+                  };
+                  break;
+                case "currentURI":
+                  getter = () => {
+                    let url = SessionStore.getLazyTabValue(aTab, "url");
+                    return Services.io.newURI(url);
+                  };
+                  break;
+                case "getTabBrowser":
+                  getter = () => {
+                    return () => {
+                      return this;
+                    };
+                  };
+                  break;
+                case "isRemoteBrowser":
+                  getter = () => {
+                    return browser.getAttribute("remote") == "true";
+                  };
+                  break;
                 case "permitUnload":
                   getter = () => {
                     return () => {
                       return { permitUnload: true, timedOut: false };
                     };
                   };
                   break;
                 case "reload":
@@ -2074,37 +2102,16 @@
                       // initializing the reload.
                       aTab.addEventListener("SSTabRestoring", () => {
                         browser[name](params);
                       }, { once: true });
                       gBrowser._insertBrowser(aTab);
                     };
                   };
                   break;
-                case "isRemoteBrowser":
-                  getter = () => {
-                    return browser.getAttribute("remote") == "true";
-                  };
-                  break;
-                case "audioMuted":
-                  getter = () => {
-                    return false;
-                  };
-                  break;
-                case "currentURI":
-                  getter = () => {
-                    let url = SessionStore.getLazyTabValue(aTab, "url");
-                    return Services.io.newURI(url);
-                  };
-                  break;
-                case "contentTitle":
-                  getter = () => {
-                    return SessionStore.getLazyTabValue(aTab, "title");
-                  };
-                  break;
                 case "userTypedValue":
                 case "userTypedClear":
                   getter = () => {
                     return SessionStore.getLazyTabValue(aTab, name);
                   };
                   break;
                 default:
                   getter = () => {