Bug 418519 - minor formatting nits in Login Manager source code. Not worth r/a.
authordolske@mozilla.com
Tue, 19 Feb 2008 16:26:19 -0800
changeset 11890 966bb0d78337b52120266c5dc427b54af759a904
parent 11889 3fa4dd0551610348de13ba5fd203bf6da68c5ce0
child 11891 5ec2d002f2d8c6fd14d07efcd40f74ab0d3074fa
push idunknown
push userunknown
push dateunknown
bugs418519
milestone1.9b4pre
Bug 418519 - minor formatting nits in Login Manager source code. Not worth r/a.
toolkit/components/passwordmgr/src/nsLoginManager.js
toolkit/components/passwordmgr/src/storage-Legacy.js
--- a/toolkit/components/passwordmgr/src/nsLoginManager.js
+++ b/toolkit/components/passwordmgr/src/nsLoginManager.js
@@ -54,58 +54,58 @@ LoginManager.prototype = {
 
 
     /* ---------- private memebers ---------- */
 
 
     __logService : null, // Console logging service, used for debugging.
     get _logService() {
         if (!this.__logService)
-            this.__logService = Cc["@mozilla.org/consoleservice;1"]
-                                    .getService(Ci.nsIConsoleService);
+            this.__logService = Cc["@mozilla.org/consoleservice;1"].
+                                getService(Ci.nsIConsoleService);
         return this.__logService;
     },
 
 
     __ioService: null, // IO service for string -> nsIURI conversion
     get _ioService() {
         if (!this.__ioService)
-            this.__ioService = Cc["@mozilla.org/network/io-service;1"]
-                                    .getService(Ci.nsIIOService);
+            this.__ioService = Cc["@mozilla.org/network/io-service;1"].
+                               getService(Ci.nsIIOService);
         return this.__ioService;
     },
 
 
     __formFillService : null, // FormFillController, for username autocompleting
     get _formFillService() {
         if (!this.__formFillService)
-            this.__formFillService = Cc[
-                                "@mozilla.org/satchel/form-fill-controller;1"]
-                                    .getService(Ci.nsIFormFillController);
+            this.__formFillService =
+                            Cc["@mozilla.org/satchel/form-fill-controller;1"].
+                            getService(Ci.nsIFormFillController);
         return this.__formFillService;
     },
 
 
     __storage : null, // Storage component which contains the saved logins
     get _storage() {
         if (!this.__storage) {
-            this.__storage = Cc["@mozilla.org/login-manager/storage/legacy;1"]
-                                .createInstance(Ci.nsILoginManagerStorage);
+            this.__storage = Cc["@mozilla.org/login-manager/storage/legacy;1"].
+                             createInstance(Ci.nsILoginManagerStorage);
             try {
                 this.__storage.init();
             } catch (e) {
                 this.log("Initialization of storage component failed: " + e);
                 this.__storage = null;
             }
         }
 
         return this.__storage;
     },
 
-    _prefBranch : null, // Preferences service
+    _prefBranch  : null, // Preferences service
     _nsLoginInfo : null, // Constructor for nsILoginInfo implementation
 
     _remember : true,  // mirrors signon.rememberSignons preference
     _debug    : false, // mirrors signon.debug
 
 
     /*
      * init
@@ -120,41 +120,41 @@ LoginManager.prototype = {
 
         // Cache references to current |this| in utility objects
         this._webProgressListener._domEventListener = this._domEventListener;
         this._webProgressListener._pwmgr = this;
         this._domEventListener._pwmgr    = this;
         this._observer._pwmgr            = this;
 
         // Preferences. Add observer so we get notified of changes.
-        this._prefBranch = Cc["@mozilla.org/preferences-service;1"]
-            .getService(Ci.nsIPrefService).getBranch("signon.");
+        this._prefBranch = Cc["@mozilla.org/preferences-service;1"].
+                           getService(Ci.nsIPrefService).getBranch("signon.");
         this._prefBranch.QueryInterface(Ci.nsIPrefBranch2);
         this._prefBranch.addObserver("", this._observer, false);
 
         // Get current preference values.
         this._debug = this._prefBranch.getBoolPref("debug");
 
         this._remember = this._prefBranch.getBoolPref("rememberSignons");
 
 
         // Get constructor for nsILoginInfo
         this._nsLoginInfo = new Components.Constructor(
             "@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo);
 
 
         // Form submit observer checks forms for new logins and pw changes.
-        var observerService = Cc["@mozilla.org/observer-service;1"]
-                                .getService(Ci.nsIObserverService);
+        var observerService = Cc["@mozilla.org/observer-service;1"].
+                              getService(Ci.nsIObserverService);
         observerService.addObserver(this._observer, "earlyformsubmit", false);
         observerService.addObserver(this._observer, "xpcom-shutdown", false);
 
         // WebProgressListener for getting notification of new doc loads.
-        var progress = Cc["@mozilla.org/docloaderservice;1"]
-                        .getService(Ci.nsIWebProgress);
+        var progress = Cc["@mozilla.org/docloaderservice;1"].
+                       getService(Ci.nsIWebProgress);
         progress.addProgressListener(this._webProgressListener,
                                      Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
 
 
     },
 
 
     /*
@@ -709,17 +709,17 @@ LoginManager.prototype = {
                 return true;
 
            return false;
         };
 
         // local helper function
         function getPrompter(aWindow) {
             var prompterSvc = Cc["@mozilla.org/login-manager/prompter;1"].
-                            createInstance(Ci.nsILoginManagerPrompter);
+                              createInstance(Ci.nsILoginManagerPrompter);
             prompterSvc.init(aWindow);
             return prompterSvc;
         }
 
         var doc = form.ownerDocument;
         var win = doc.defaultView;
 
         // If password saving is disabled (globally or for host), bail out now.
@@ -1168,18 +1168,18 @@ UserAutoCompleteResult.prototype = {
 
         var [removedLogin] = this.logins.splice(index, 1);
 
         this.matchCount--;
         if (this.defaultIndex > this.logins.length)
             this.defaultIndex--;
 
         if (removeFromDB) {
-            var pwmgr = Cc["@mozilla.org/login-manager;1"]
-                            .getService(Ci.nsILoginManager);
+            var pwmgr = Cc["@mozilla.org/login-manager;1"].
+                        getService(Ci.nsILoginManager);
             pwmgr.removeLogin(removedLogin);
         }
     },
 };
 
 var component = [LoginManager];
 function NSGetModule (compMgr, fileSpec) {
     return XPCOMUtils.generateModule(component);
--- a/toolkit/components/passwordmgr/src/storage-Legacy.js
+++ b/toolkit/components/passwordmgr/src/storage-Legacy.js
@@ -125,27 +125,27 @@ LoginManagerStorage_legacy.prototype = {
      *
      * Initialize this storage component and load stored passwords from disk.
      */
     init : function () {
         this._logins  = {};
         this._disabledHosts = {};
 
         // Connect to the correct preferences branch.
-        this._prefBranch = Cc["@mozilla.org/preferences-service;1"]
-                                .getService(Ci.nsIPrefService);
+        this._prefBranch = Cc["@mozilla.org/preferences-service;1"].
+                           getService(Ci.nsIPrefService);
         this._prefBranch = this._prefBranch.getBranch("signon.");
         this._prefBranch.QueryInterface(Ci.nsIPrefBranch2);
 
         this._debug = this._prefBranch.getBoolPref("debug");
 
         // Check to see if the internal PKCS#11 token has been initialized.
         // If not, set a blank password.
-        var tokenDB = Cc["@mozilla.org/security/pk11tokendb;1"]
-                            .getService(Ci.nsIPK11TokenDB);
+        var tokenDB = Cc["@mozilla.org/security/pk11tokendb;1"].
+                      getService(Ci.nsIPK11TokenDB);
 
         var token = tokenDB.getInternalKeyToken();
         if (token.needsUserInit) {
             this.log("Initializing key3.db with default blank password.");
             token.initPassword("");
         }
 
         var importFile = null;
@@ -759,18 +759,18 @@ LoginManagerStorage_legacy.prototype = {
 
         // If it doesn't exist, just create an empty file and bail out.
         if (!this._signonsFile.exists()) {
             this.log("Creating new signons file...");
             this._writeFile();
             return;
         }
 
-        var inputStream = Cc["@mozilla.org/network/file-input-stream;1"]
-                                .createInstance(Ci.nsIFileInputStream);
+        var inputStream = Cc["@mozilla.org/network/file-input-stream;1"].
+                          createInstance(Ci.nsIFileInputStream);
         // init the stream as RD_ONLY, -1 == default permissions.
         inputStream.init(this._signonsFile, 0x01, -1, null);
         var lineStream = inputStream.QueryInterface(Ci.nsILineInputStream);
         var line = { value: "" };
 
         const STATE = { HEADER : 0, REJECT : 1, REALM : 2,
                         USERFIELD : 3, USERVALUE : 4,
                         PASSFIELD : 5, PASSVALUE : 6, ACTIONURL : 7,
@@ -1213,18 +1213,18 @@ LoginManagerStorage_legacy.prototype = {
             if (cipherText.charAt(0) == '~') {
                 // The older file format obscured entries by
                 // base64-encoding them. These entries are signaled by a
                 // leading '~' character. 
                 plainOctet = atob(cipherText.substring(1));
             } else {
                 plainOctet = this._decoderRing.decryptString(cipherText);
             }
-            var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
-                              .createInstance(Ci.nsIScriptableUnicodeConverter);
+            var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
+                            createInstance(Ci.nsIScriptableUnicodeConverter);
             converter.charset = "UTF-8";
             plainText = converter.ConvertToUnicode(plainOctet);
         } catch (e) {
             this.log("Failed to decrypt string: " + cipherText +
                 " (" + e.name + ")");
 
             // If the user clicks Cancel, we get NS_ERROR_NOT_AVAILABLE.
             // If the cipherText is bad / wrong key, we get NS_ERROR_FAILURE