Bug 823732 - Remove the usage of the global PB service from nsSessionStartup.js in per-window PB builds; r=jdm
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 20 Dec 2012 17:50:35 -0500
changeset 125884 afbdeaf92ab39a7bacb06930c5b42fa176f5b80f
parent 125883 d30aa82fb5de64d3a6fcf668fafcced4455463d4
child 125885 3b36ac0574c7e02e68df9171ea615a7824ea8cd9
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs823732
milestone20.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 823732 - Remove the usage of the global PB service from nsSessionStartup.js in per-window PB builds; r=jdm
browser/components/sessionstore/src/Makefile.in
browser/components/sessionstore/src/nsSessionStartup.js
--- a/browser/components/sessionstore/src/Makefile.in
+++ b/browser/components/sessionstore/src/Makefile.in
@@ -8,19 +8,20 @@ srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/config.mk
 
 EXTRA_COMPONENTS = \
   nsSessionStore.manifest \
   nsSessionStore.js \
-  nsSessionStartup.js \
   $(NULL)
 
+EXTRA_PP_COMPONENTS := nsSessionStartup.js
+
 JS_MODULES_PATH := $(FINAL_TARGET)/modules/sessionstore
 
 EXTRA_JS_MODULES := \
   DocumentUtils.jsm \
   SessionStorage.jsm \
   XPathGenerator.jsm \
   _SessionFile.jsm \
   $(NULL)
--- a/browser/components/sessionstore/src/nsSessionStartup.js
+++ b/browser/components/sessionstore/src/nsSessionStartup.js
@@ -68,21 +68,25 @@ SessionStartup.prototype = {
 /* ........ Global Event Handlers .............. */
 
   /**
    * Initialize the component
    */
   init: function sss_init() {
     debug("init starting");
     // do not need to initialize anything in auto-started private browsing sessions
+    if (PrivateBrowsingUtils.permanentPrivateBrowsing)
+      return;
+
+#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
     let pbs = Cc["@mozilla.org/privatebrowsing;1"].
               getService(Ci.nsIPrivateBrowsingService);
-    if (PrivateBrowsingUtils.permanentPrivateBrowsing ||
-        pbs.lastChangedByCommandLine)
+    if (pbs.lastChangedByCommandLine)
       return;
+#endif
     // Session state is unknown until we read the file.
     this._sessionType = null;
     _SessionFile.read().then(
       this._onSessionFileRead.bind(this)
     );
     debug("init launched");
   },