Bug 1127158 - Remove brittle debug only flag math in nsSecureBrowserUIImpl.cpp. r=dkeeler
authorCykesiopka <cykesiopka.bmo@gmail.com>
Fri, 01 Apr 2016 06:16:58 -0700
changeset 347765 8cdccb1dd539f9bc3a89ed8791b6e1bdc2544992
parent 347764 d6836561de7b0f96c977cc2e1f5b348030a7107d
child 347766 37b60f2ed39c01ee7e108ee5a8ccdd1aa3a173f8
push id14654
push userbmo:rail@mozilla.com
push dateTue, 05 Apr 2016 19:30:33 +0000
reviewersdkeeler
bugs1127158
milestone48.0a1
Bug 1127158 - Remove brittle debug only flag math in nsSecureBrowserUIImpl.cpp. r=dkeeler MozReview-Commit-ID: 3d5mYDjzJwf
security/manager/ssl/nsSecureBrowserUIImpl.cpp
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -704,124 +704,16 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
                                    nsIProtocolHandler::URI_IS_LOCAL_RESOURCE,
                                    &hasFlag);
     if (NS_SUCCEEDED(rv) && hasFlag) {
       isSubDocumentRelevant = false;
     }
   }
 
 #if defined(DEBUG)
-  nsCString info2;
-  uint32_t testFlags = loadFlags;
-
-  if (testFlags & nsIChannel::LOAD_DOCUMENT_URI)
-  {
-    testFlags -= nsIChannel::LOAD_DOCUMENT_URI;
-    info2.AppendLiteral("LOAD_DOCUMENT_URI ");
-  }
-  if (testFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI)
-  {
-    testFlags -= nsIChannel::LOAD_RETARGETED_DOCUMENT_URI;
-    info2.AppendLiteral("LOAD_RETARGETED_DOCUMENT_URI ");
-  }
-  if (testFlags & nsIChannel::LOAD_REPLACE)
-  {
-    testFlags -= nsIChannel::LOAD_REPLACE;
-    info2.AppendLiteral("LOAD_REPLACE ");
-  }
-
-  const char *_status = NS_SUCCEEDED(aStatus) ? "1" : "0";
-
-  nsCString info;
-  uint32_t f = aProgressStateFlags;
-  if (f & nsIWebProgressListener::STATE_START)
-  {
-    f -= nsIWebProgressListener::STATE_START;
-    info.AppendLiteral("START ");
-  }
-  if (f & nsIWebProgressListener::STATE_REDIRECTING)
-  {
-    f -= nsIWebProgressListener::STATE_REDIRECTING;
-    info.AppendLiteral("REDIRECTING ");
-  }
-  if (f & nsIWebProgressListener::STATE_TRANSFERRING)
-  {
-    f -= nsIWebProgressListener::STATE_TRANSFERRING;
-    info.AppendLiteral("TRANSFERRING ");
-  }
-  if (f & nsIWebProgressListener::STATE_NEGOTIATING)
-  {
-    f -= nsIWebProgressListener::STATE_NEGOTIATING;
-    info.AppendLiteral("NEGOTIATING ");
-  }
-  if (f & nsIWebProgressListener::STATE_STOP)
-  {
-    f -= nsIWebProgressListener::STATE_STOP;
-    info.AppendLiteral("STOP ");
-  }
-  if (f & nsIWebProgressListener::STATE_IS_REQUEST)
-  {
-    f -= nsIWebProgressListener::STATE_IS_REQUEST;
-    info.AppendLiteral("IS_REQUEST ");
-  }
-  if (f & nsIWebProgressListener::STATE_IS_DOCUMENT)
-  {
-    f -= nsIWebProgressListener::STATE_IS_DOCUMENT;
-    info.AppendLiteral("IS_DOCUMENT ");
-  }
-  if (f & nsIWebProgressListener::STATE_IS_NETWORK)
-  {
-    f -= nsIWebProgressListener::STATE_IS_NETWORK;
-    info.AppendLiteral("IS_NETWORK ");
-  }
-  if (f & nsIWebProgressListener::STATE_IS_WINDOW)
-  {
-    f -= nsIWebProgressListener::STATE_IS_WINDOW;
-    info.AppendLiteral("IS_WINDOW ");
-  }
-  if (f & nsIWebProgressListener::STATE_IS_INSECURE)
-  {
-    f -= nsIWebProgressListener::STATE_IS_INSECURE;
-    info.AppendLiteral("IS_INSECURE ");
-  }
-  if (f & nsIWebProgressListener::STATE_IS_BROKEN)
-  {
-    f -= nsIWebProgressListener::STATE_IS_BROKEN;
-    info.AppendLiteral("IS_BROKEN ");
-  }
-  if (f & nsIWebProgressListener::STATE_IS_SECURE)
-  {
-    f -= nsIWebProgressListener::STATE_IS_SECURE;
-    info.AppendLiteral("IS_SECURE ");
-  }
-  if (f & nsIWebProgressListener::STATE_SECURE_HIGH)
-  {
-    f -= nsIWebProgressListener::STATE_SECURE_HIGH;
-    info.AppendLiteral("SECURE_HIGH ");
-  }
-  if (f & nsIWebProgressListener::STATE_CERT_USER_OVERRIDDEN)
-  {
-    f -= nsIWebProgressListener::STATE_CERT_USER_OVERRIDDEN;
-    info.AppendLiteral("STATE_CERT_USER_OVERRIDDEN ");
-  }
-  if (f & nsIWebProgressListener::STATE_RESTORING)
-  {
-    f -= nsIWebProgressListener::STATE_RESTORING;
-    info.AppendLiteral("STATE_RESTORING ");
-  }
-
-  if (f > 0)
-  {
-    info.AppendLiteral("f contains unknown flag!");
-  }
-
-  MOZ_LOG(gSecureDocLog, LogLevel::Debug,
-         ("SecureUI:%p: OnStateChange: %s %s -- %s\n", this, _status, 
-          info.get(), info2.get()));
-
   if (aProgressStateFlags & STATE_STOP
       &&
       channel)
   {
     MOZ_LOG(gSecureDocLog, LogLevel::Debug,
            ("SecureUI:%p: OnStateChange: seeing STOP with security state: %d\n", this,
             GetSecurityStateFromSecurityInfoAndRequest(securityInfo, aRequest)
             ));