Bug 839961 - Refactor login manager's content actions into a separate JSM. (bug 881996 workaround) r=mattn
authorJustin Dolske <dolske@mozilla.com>
Wed, 19 Jun 2013 16:30:53 -0700
changeset 135707 1213ea1ff91a09cdf209389d79229d10e3bac56a
parent 135706 f5df5ee7bd177a4863ea551060c45d92c27e0e2a
child 135708 d68f2618ea70ea445e0acfcd800e9c78c536d2cc
push id29788
push userjdolske@mozilla.com
push dateWed, 19 Jun 2013 23:32:06 +0000
treeherdermozilla-inbound@1213ea1ff91a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattn
bugs839961, 881996
milestone24.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 839961 - Refactor login manager's content actions into a separate JSM. (bug 881996 workaround) r=mattn
toolkit/components/passwordmgr/nsLoginManager.js
--- a/toolkit/components/passwordmgr/nsLoginManager.js
+++ b/toolkit/components/passwordmgr/nsLoginManager.js
@@ -129,16 +129,22 @@ LoginManager.prototype = {
 
         // Get current preference values.
         debug = this._prefBranch.getBoolPref("debug");
 
         this._remember = this._prefBranch.getBoolPref("rememberSignons");
 
         // Form submit observer checks forms for new logins and pw changes.
         Services.obs.addObserver(this._observer, "xpcom-shutdown", false);
+
+        // XXX gross hacky workaround for bug 881996. The WPL does nothing.
+        var progress = Cc["@mozilla.org/docloaderservice;1"].
+                       getService(Ci.nsIWebProgress);
+        progress.addProgressListener(this._webProgressListener,
+                                     Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
     },
 
 
     /* ---------- Utility objects ---------- */
 
 
     /*
      * _observer object
@@ -176,16 +182,27 @@ LoginManager.prototype = {
                 this._pwmgr = null;
             } else {
                 log("Oops! Unexpected notification:", topic);
             }
         }
     },
 
 
+    _webProgressListener : {
+        QueryInterface : XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
+                                                Ci.nsISupportsWeakReference]),
+        onStateChange    : function() { /* NOP */ },
+        onProgressChange : function() { throw "Unexpected onProgressChange"; },
+        onLocationChange : function() { throw "Unexpected onLocationChange"; },
+        onStatusChange   : function() { throw "Unexpected onStatusChange";   },
+        onSecurityChange : function() { throw "Unexpected onSecurityChange"; }
+    },
+
+
 
 
     /* ---------- Primary Public interfaces ---------- */
 
 
 
 
     /*