From 93cba982be9d006cf24d313b3f2d7eb7ca545027 Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Thu, 18 Sep 2014 08:56:55 -0700 Subject: [PATCH] Bug 1066447 - Make cloudsync test work in e10s (r=ttaubert) --- services/cloudsync/CloudSyncTabs.jsm | 3 +-- toolkit/modules/PrivateBrowsingUtils.jsm | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/services/cloudsync/CloudSyncTabs.jsm b/services/cloudsync/CloudSyncTabs.jsm index b0921b709bc..ba9077999b0 100644 --- a/services/cloudsync/CloudSyncTabs.jsm +++ b/services/cloudsync/CloudSyncTabs.jsm @@ -148,8 +148,7 @@ this.Tabs = function () { let update = function (event) { if (event.originalTarget.linkedBrowser) { - let win = event.originalTarget.linkedBrowser.contentWindow; - if (PrivateBrowsingUtils.isWindowPrivate(win) && + if (PrivateBrowsingUtils.isBrowserPrivate(event.originalTarget.linkedBrowser) && !PrivateBrowsingUtils.permanentPrivateBrowsing) { return; } diff --git a/toolkit/modules/PrivateBrowsingUtils.jsm b/toolkit/modules/PrivateBrowsingUtils.jsm index 1c013dcaefd..847160e21b0 100644 --- a/toolkit/modules/PrivateBrowsingUtils.jsm +++ b/toolkit/modules/PrivateBrowsingUtils.jsm @@ -16,10 +16,16 @@ const Cc = Components.classes; const Ci = Components.interfaces; this.PrivateBrowsingUtils = { + // Rather than passing content windows to this function, please use + // isBrowserPrivate since it works with e10s. isWindowPrivate: function pbu_isWindowPrivate(aWindow) { return this.privacyContextFromWindow(aWindow).usePrivateBrowsing; }, + isBrowserPrivate: function(aBrowser) { + return this.isWindowPrivate(aBrowser.ownerDocument.defaultView); + }, + privacyContextFromWindow: function pbu_privacyContextFromWindow(aWindow) { return aWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation)