[Pkg-privacy-commits] [xul-ext-monkeysphere] 241/296: some small code cleanup and simplification

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository xul-ext-monkeysphere.

commit 3773b86ca0a78274fc258c25cf55917b7d7f3d28
Author: Jameson Rollins <jrollins at finestructure.net>
Date:   Thu May 6 08:36:28 2010 -0400

    some small code cleanup and simplification
---
 Changelog                      |  6 +++++
 chrome/content/monkeysphere.js | 17 +++++++------
 modules/monkeysphere.jsm       | 54 +++++++++++++++++++++++-------------------
 3 files changed, 43 insertions(+), 34 deletions(-)

diff --git a/Changelog b/Changelog
index ba9a3a3..65249f6 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,9 @@
+xul-ext-monkeysphere (0.5~pre) unstable; urgency=low
+
+  * code cleanup
+
+ -- Jameson Rollins <jrollins at finestructure.net>  Thu, 06 May 2010 08:20:15 -0400
+
 xul-ext-monkeysphere (0.4); urgency=low
 
   * auto-generate install.rdf to ensure proper version numbers.
diff --git a/chrome/content/monkeysphere.js b/chrome/content/monkeysphere.js
index b4496c5..c1715f2 100644
--- a/chrome/content/monkeysphere.js
+++ b/chrome/content/monkeysphere.js
@@ -34,7 +34,7 @@ var monkeysphere = (function() {
   //////////////////////////////////////////////////////////
   // check site monkeysphere status
   var checkSite = function(browser, state) {
-    ms.log("check site:");
+    ms.log("%%%% checking site %%%%");
 
     var uri = browser.currentURI;
 
@@ -46,10 +46,9 @@ var monkeysphere = (function() {
 
     ////////////////////////////////////////
     // check browser state
-    ms.log("checking security state: " + state);
     // if site secure...
     if(state & Components.interfaces.nsIWebProgressListener.STATE_IS_SECURE) {
-      ms.log("  site state SECURE.");
+      ms.log("security state: SECURE.");
 
       // if a monkeysphere-generated cert override is being used by this connection, then we should be setting the status from the override
       var cert = browser.securityUI.SSLStatus.serverCert;
@@ -64,7 +63,7 @@ var monkeysphere = (function() {
       return;
 
     } else if(state & Components.interfaces.nsIWebProgressListener.STATE_IS_BROKEN) {
-      ms.log("  site state BROKEN");
+      ms.log("security state: BROKEN");
 
       // if a monkeysphere-generated cert override is being used by this connection, then we should be setting the status from the override
       try {
@@ -87,16 +86,16 @@ var monkeysphere = (function() {
 
     // if site insecure continue
     } else if(state & Components.interfaces.nsIWebProgressListener.STATE_IS_INSECURE) {
-      ms.log("  site state INSECURE");
+      ms.log("security state: INSECURE");
 
     // else if unknown state continue
     } else {
-      ms.log("  site state is unknown");
+      ms.log("security state: UNKNOWN");
     }
 
     ////////////////////////////////////////
     // get site certificate
-    ms.log("retrieving site certificate:");
+    ms.log("retrieving site certificate...");
     var cert = ms.getInvalidCert(uri);
 
     ////////////////////////////////////////
@@ -272,12 +271,12 @@ var monkeysphere = (function() {
       onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocation) {},
       onProgressChange: function(aBrowser, awebProgress, aRequest, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress) {},
       onSecurityChange: function(aBrowser, aWebProgress, aRequest, aState) {
-        ms.log("++++ tabPL security change: ");
+        ms.log("++++ tabPL security change: " + aState);
         checkSite(aBrowser, aState);
         updateDisplay();
       },
       onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
-        ms.log("++++ tabPL state change: " + aRequest);
+        ms.log("++++ tabPL state change: " + aStateFlags);
         updateDisplay();
       },
       onStatusChange: function(aBrowser, aWebProgress, aRequest, aStatus, aMessage) {}
diff --git a/modules/monkeysphere.jsm b/modules/monkeysphere.jsm
index 13d913d..b3789d4 100644
--- a/modules/monkeysphere.jsm
+++ b/modules/monkeysphere.jsm
@@ -145,8 +145,10 @@ var isRelevantURI = function(uri) {
 var setStatus = function(browser, state, message) {
   if ( typeof message === 'undefined' ) {
     message = "";
+    log("set browser status: " + state);
+  } else {
+    log("set browser status: " + state + ', ' + message);
   }
-  log("set browser status: " + state + ', ' + message);
   browser.monkeysphere = { state: state, message: message };
 };
 
@@ -251,41 +253,41 @@ var printCertInfo = function(cert) {
   log("certificate:");
   switch (cert.verifyForUsage(Ci.nsIX509Cert.CERT_USAGE_SSLServer)) {
     case Ci.nsIX509Cert.VERIFIED_OK:
-      log("\tSSL status: OK");
+      log("  SSL status: OK");
       break;
     case Ci.nsIX509Cert.NOT_VERIFIED_UNKNOWN:
-      log("\tSSL status: not verfied/unknown");
+      log("  SSL status: not verfied/unknown");
       break;
     case Ci.nsIX509Cert.CERT_REVOKED:
-      log("\tSSL status: revoked");
+      log("  SSL status: revoked");
       break;
     case Ci.nsIX509Cert.CERT_EXPIRED:
-      log("\tSSL status: expired");
+      log("  SSL status: expired");
       break;
     case Ci.nsIX509Cert.CERT_NOT_TRUSTED:
-      log("\tSSL status: not trusted");
+      log("  SSL status: not trusted");
       break;
     case Ci.nsIX509Cert.ISSUER_NOT_TRUSTED:
-      log("\tSSL status: issuer not trusted");
+      log("  SSL status: issuer not trusted");
       break;
     case Ci.nsIX509Cert.ISSUER_UNKNOWN:
-      log("\tSSL status: issuer unknown");
+      log("  SSL status: issuer unknown");
       break;
     case Ci.nsIX509Cert.INVALID_CA:
-      log("\tSSL status: invalid CA");
+      log("  SSL status: invalid CA");
       break;
     default:
-      log("\tSSL status: unexpected failure");
+      log("  SSL status: unexpected failure");
       break;
   }
-  log("\tCommon Name: " + cert.commonName);
-  log("\tOrganisation: " + cert.organization);
-  log("\tIssuer: " + cert.issuerOrganization);
-  log("\tSHA1 fingerprint: " + cert.sha1Fingerprint);
+  log("  Common Name: " + cert.commonName);
+  log("  Organisation: " + cert.organization);
+  log("  Issuer: " + cert.issuerOrganization);
+  log("  SHA1 fingerprint: " + cert.sha1Fingerprint);
 
   var validity = cert.validity.QueryInterface(Ci.nsIX509CertValidity);
-  log("\tValid from: " + validity.notBeforeGMT);
-  log("\tValid until: " + validity.notAfterGMT);
+  log("  Valid from: " + validity.notBeforeGMT);
+  log("  Valid until: " + validity.notAfterGMT);
 };
 
 ////////////////////////////////////////////////////////////
@@ -331,10 +333,11 @@ var overrides = (
         log("overrideBits: " + overrideBits);
 
         log("set cert override: " + uri.asciiHost + ":" + uri.port);
-        certOverrideService.rememberValidityOverride(uri.asciiHost, uri.port,
-                                                                  cert,
-                                                                  overrideBits,
-                                                                  true);
+        certOverrideService.rememberValidityOverride(uri.asciiHost,
+                                                     uri.port,
+                                                     cert,
+                                                     overrideBits,
+                                                     true);
 
         log("setting cache");
         apd.log();
@@ -353,11 +356,12 @@ var overrides = (
         var aFingerprint = {};
         var aOverrideBits = {};
         var aIsTemporary = {};
-        return certOverrideService.getValidityOverride(uri.asciiHost, uri.port,
-                                                                    aHashAlg,
-                                                                    aFingerprint,
-                                                                    aOverrideBits,
-                                                                    aIsTemporary);
+        return certOverrideService.getValidityOverride(uri.asciiHost,
+                                                       uri.port,
+                                                       aHashAlg,
+                                                       aFingerprint,
+                                                       aOverrideBits,
+                                                       aIsTemporary);
       },
 
       // clear override

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/xul-ext-monkeysphere.git



More information about the Pkg-privacy-commits mailing list