Bug 1162691 - Part 1: Remove instances of #ifdef PR_LOGGING in security. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Fri, 08 May 2015 14:36:33 -0700
changeset 243072 3cdce28ffcc6de50fac4fce22a8bca0a467db44b
parent 243071 0536b35fa2fa6ed3b5685fe9357dcb4c81b94251
child 243073 b969ae256202f04f3d61618619a7216055163c70
push id28720
push userphilringnalda@gmail.com
push dateSat, 09 May 2015 21:17:12 +0000
treeherdermozilla-central@30bfca777090 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1162691
milestone40.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 1162691 - Part 1: Remove instances of #ifdef PR_LOGGING in security. r=froydnj PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
security/apps/AppSignatureVerification.cpp
security/apps/AppTrustDomain.cpp
security/certverifier/CertVerifier.cpp
security/certverifier/ExtendedValidation.cpp
security/certverifier/NSSCertDBTrustDomain.cpp
security/certverifier/OCSPCache.cpp
security/certverifier/OCSPRequestor.cpp
security/manager/boot/src/PublicKeyPinningService.cpp
security/manager/boot/src/RootCertificateTelemetryUtils.cpp
security/manager/boot/src/nsSecureBrowserUIImpl.cpp
security/manager/boot/src/nsSecurityHeaderParser.cpp
security/manager/boot/src/nsSiteSecurityService.cpp
security/manager/ssl/src/PSMContentListener.cpp
security/manager/ssl/src/SSLServerCertVerification.cpp
security/manager/ssl/src/nsCertTree.cpp
security/manager/ssl/src/nsNSSCallbacks.cpp
security/manager/ssl/src/nsNSSCertificate.cpp
security/manager/ssl/src/nsNSSCertificateDB.cpp
security/manager/ssl/src/nsNSSComponent.cpp
security/manager/ssl/src/nsNSSIOLayer.cpp
security/manager/ssl/src/nsNSSShutDown.cpp
security/manager/ssl/src/nsNTLMAuthModule.cpp
security/manager/ssl/src/nsPK11TokenDB.cpp
security/manager/ssl/src/nsPKCS11Slot.cpp
security/manager/ssl/src/nsPKCS12Blob.cpp
security/manager/ssl/src/nsUsageArrayHelper.cpp
--- a/security/apps/AppSignatureVerification.cpp
+++ b/security/apps/AppSignatureVerification.cpp
@@ -35,19 +35,17 @@
 #include "pkix/pkixnss.h"
 #include "secmime.h"
 
 
 using namespace mozilla::pkix;
 using namespace mozilla;
 using namespace mozilla::psm;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 namespace {
 
 // Reads a maximum of 1MB from a stream into the supplied buffer.
 // The reason for the 1MB limit is because this function is used to read
 // signature-related files and we want to avoid OOM. The uncompressed length of
 // an entry can be hundreds of times larger than the compressed version,
 // especially if someone has specifically crafted the entry to cause OOM or to
--- a/security/apps/AppTrustDomain.cpp
+++ b/security/apps/AppTrustDomain.cpp
@@ -24,19 +24,17 @@
 #include "manifest-signing-root.inc"
 #include "manifest-signing-test-root.inc"
 // Add-on signing Certificates
 #include "addons-public.inc"
 #include "addons-stage.inc"
 
 using namespace mozilla::pkix;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 static const unsigned int DEFAULT_MIN_RSA_BITS = 2048;
 
 namespace mozilla { namespace psm {
 
 AppTrustDomain::AppTrustDomain(ScopedCERTCertList& certChain, void* pinArg)
   : mCertChain(certChain)
   , mPinArg(pinArg)
--- a/security/certverifier/CertVerifier.cpp
+++ b/security/certverifier/CertVerifier.cpp
@@ -18,19 +18,17 @@
 #include "pkix/pkixnss.h"
 #include "prerror.h"
 #include "secerr.h"
 #include "sslerr.h"
 
 using namespace mozilla::pkix;
 using namespace mozilla::psm;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gCertVerifierLog = nullptr;
-#endif
 
 namespace mozilla { namespace psm {
 
 const CertVerifier::Flags CertVerifier::FLAG_LOCAL_ONLY = 1;
 const CertVerifier::Flags CertVerifier::FLAG_MUST_BE_EV = 2;
 
 CertVerifier::CertVerifier(OcspDownloadConfig odc,
                            OcspStrictConfig osc,
@@ -45,21 +43,19 @@ CertVerifier::CertVerifier(OcspDownloadC
 
 CertVerifier::~CertVerifier()
 {
 }
 
 void
 InitCertVerifierLog()
 {
-#ifdef PR_LOGGING
   if (!gCertVerifierLog) {
     gCertVerifierLog = PR_NewLogModule("certverifier");
   }
-#endif
 }
 
 SECStatus
 IsCertBuiltInRoot(CERTCertificate* cert, bool& result) {
   result = false;
   ScopedPK11SlotList slots;
   slots = PK11_GetAllSlotsForCert(cert, nullptr);
   if (!slots) {
--- a/security/certverifier/ExtendedValidation.cpp
+++ b/security/certverifier/ExtendedValidation.cpp
@@ -11,19 +11,17 @@
 #include "base64.h"
 #include "hasht.h"
 #include "pkix/pkixtypes.h"
 #include "pk11pub.h"
 #include "secerr.h"
 #include "prerror.h"
 #include "prinit.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 #define CONST_OID static const unsigned char
 #define OI(x) { siDEROID, (unsigned char*) x, sizeof x }
 
 struct nsMyTrustedEVInfo
 {
   const char* dotted_oid;
   const char* oid_name; // Set this to null to signal an invalid structure,
--- a/security/certverifier/NSSCertDBTrustDomain.cpp
+++ b/security/certverifier/NSSCertDBTrustDomain.cpp
@@ -26,19 +26,17 @@
 #include "ScopedNSSTypes.h"
 #include "secerr.h"
 
 #include "CNNICHashWhitelist.inc"
 
 using namespace mozilla;
 using namespace mozilla::pkix;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gCertVerifierLog;
-#endif
 
 static const uint64_t ServerFailureDelaySeconds = 5 * 60;
 
 namespace mozilla { namespace psm {
 
 const char BUILTIN_ROOTS_MODULE_DEFAULT_NAME[] = "Builtin Roots Module";
 
 NSSCertDBTrustDomain::NSSCertDBTrustDomain(SECTrustType certDBTrustType,
--- a/security/certverifier/OCSPCache.cpp
+++ b/security/certverifier/OCSPCache.cpp
@@ -27,19 +27,17 @@
 #include <limits>
 
 #include "NSSCertDBTrustDomain.h"
 #include "pk11pub.h"
 #include "pkix/pkixnss.h"
 #include "ScopedNSSTypes.h"
 #include "secerr.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gCertVerifierLog;
-#endif
 
 using namespace mozilla::pkix;
 
 namespace mozilla { namespace psm {
 
 // Let derIssuer be the DER encoding of the issuer of aCert.
 // Let derPublicKey be the DER encoding of the public key of aIssuerCert.
 // Let serialNumber be the bytes of the serial number of aCert.
--- a/security/certverifier/OCSPRequestor.cpp
+++ b/security/certverifier/OCSPRequestor.cpp
@@ -11,19 +11,17 @@
 #include "mozilla/Base64.h"
 #include "mozilla/Scoped.h"
 #include "nsIURLParser.h"
 #include "nsNSSCallbacks.h"
 #include "nsNetCID.h"
 #include "nsServiceManagerUtils.h"
 #include "secerr.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gCertVerifierLog;
-#endif
 
 namespace mozilla {
 
 void
 ReleaseHttpServerSession(nsNSSHttpServerSession* httpServerSession)
 {
   delete httpServerSession;
 }
--- a/security/manager/boot/src/PublicKeyPinningService.cpp
+++ b/security/manager/boot/src/PublicKeyPinningService.cpp
@@ -20,20 +20,18 @@
 #include "seccomon.h"
 #include "sechash.h"
 #include "StaticHPKPins.h" // autogenerated by genHPKPStaticpins.js
 
 using namespace mozilla;
 using namespace mozilla::pkix;
 using namespace mozilla::psm;
 
-#if defined(PR_LOGGING)
 PRLogModuleInfo* gPublicKeyPinningLog =
   PR_NewLogModule("PublicKeyPinningService");
-#endif
 
 /**
  Computes in the location specified by base64Out the SHA256 digest
  of the DER Encoded subject Public Key Info for the given cert
 */
 static nsresult
 GetBase64HashSPKI(const CERTCertificate* cert, SECOidTag hashType,
                   nsACString& hashSPKIDigest)
--- a/security/manager/boot/src/RootCertificateTelemetryUtils.cpp
+++ b/security/manager/boot/src/RootCertificateTelemetryUtils.cpp
@@ -14,20 +14,18 @@
 // Note: New CAs will show up as UNKNOWN_ROOT until
 // RootHashes.inc is updated to include them. 0 is reserved by
 // genRootCAHashes.js for the unknowns.
 #define UNKNOWN_ROOT  0
 #define HASH_FAILURE -1
 
 namespace mozilla { namespace psm { 
 
-#if defined(PR_LOGGING)
 PRLogModuleInfo* gPublicKeyPinningTelemetryLog =
   PR_NewLogModule("PublicKeyPinningTelemetryService");
-#endif
 
 // Used in the BinarySearch method, this does a memcmp between the pointer
 // provided to its construtor and whatever the binary search is looking for.
 //
 // This implementation assumes everything to be of HASH_LEN, so it should not
 // be used generically.
 class BinaryHashSearchArrayComparator
 {
@@ -91,9 +89,9 @@ AccumulateTelemetryForRootCA(mozilla::Te
   int32_t binId = RootCABinNumber(&cert->derCert);
 
   if (binId != HASH_FAILURE) {
     Accumulate(probe, binId);
   }
 }
 
 } // namespace psm
-} // namespace mozilla
\ No newline at end of file
+} // namespace mozilla
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -31,30 +31,28 @@
 #include "imgIRequest.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsCRT.h"
 
 using namespace mozilla;
 
-#if defined(PR_LOGGING)
 //
 // Log module for nsSecureBrowserUI logging...
 //
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsSecureBrowserUI:5
 //    set NSPR_LOG_FILE=nspr.log
 //
 // this enables PR_LOG_DEBUG level information and places all output in
 // the file nspr.log
 //
 PRLogModuleInfo* gSecureDocLog = nullptr;
-#endif /* PR_LOGGING */
 
 struct RequestHashEntry : PLDHashEntryHdr {
     void *r;
 };
 
 static bool
 RequestMapMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
                          const void *key)
@@ -111,20 +109,18 @@ nsSecureBrowserUIImpl::nsSecureBrowserUI
   , mRestoreSubrequests(false)
   , mOnLocationChangeSeen(false)
 #ifdef DEBUG
   , mOnStateLocationChangeReentranceDetection(0)
 #endif
 {
   ResetStateTracking();
   
-#if defined(PR_LOGGING)
   if (!gSecureDocLog)
     gSecureDocLog = PR_NewLogModule("nsSecureBrowserUI");
-#endif /* PR_LOGGING */
 }
 
 nsSecureBrowserUIImpl::~nsSecureBrowserUIImpl()
 {
   if (mTransferringRequests.IsInitialized()) {
     PL_DHashTableFinish(&mTransferringRequests);
   }
 }
@@ -133,24 +129,21 @@ NS_IMPL_ISUPPORTS(nsSecureBrowserUIImpl,
                   nsISecureBrowserUI,
                   nsIWebProgressListener,
                   nsISupportsWeakReference,
                   nsISSLStatusProvider)
 
 NS_IMETHODIMP
 nsSecureBrowserUIImpl::Init(nsIDOMWindow *aWindow)
 {
-
-#ifdef PR_LOGGING
   nsCOMPtr<nsIDOMWindow> window(do_QueryReferent(mWindow));
 
   PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
          ("SecureUI:%p: Init: mWindow: %p, aWindow: %p\n", this,
           window.get(), aWindow));
-#endif
 
   if (!aWindow) {
     NS_WARNING("Null window passed to nsSecureBrowserUIImpl::Init()");
     return NS_ERROR_INVALID_ARG;
   }
 
   if (mWindow) {
     NS_WARNING("Trying to init an nsSecureBrowserUIImpl twice");
@@ -613,17 +606,16 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
   if (httpChannel) 
   {
     uint32_t response;
     isNoContentResponse = NS_SUCCEEDED(httpChannel->GetResponseStatus(&response)) &&
         (response == 204 || response == 205);
   }
   const bool isToplevelProgress = (windowForProgress.get() == window.get()) && !isNoContentResponse;
   
-#ifdef PR_LOGGING
   if (windowForProgress)
   {
     if (isToplevelProgress)
     {
       PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
              ("SecureUI:%p: OnStateChange: progress: for toplevel\n", this));
     }
     else
@@ -632,40 +624,37 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
              ("SecureUI:%p: OnStateChange: progress: for something else\n", this));
     }
   }
   else
   {
       PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
              ("SecureUI:%p: OnStateChange: progress: no window known\n", this));
   }
-#endif
 
   PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
          ("SecureUI:%p: OnStateChange\n", this));
 
   if (isViewSource)
     return NS_OK;
 
   if (!aRequest)
   {
     PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
            ("SecureUI:%p: OnStateChange with null request\n", this));
     return NS_ERROR_NULL_POINTER;
   }
 
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(gSecureDocLog, PR_LOG_DEBUG)) {
     nsXPIDLCString reqname;
     aRequest->GetName(reqname);
     PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
            ("SecureUI:%p: %p %p OnStateChange %x %s\n", this, aWebProgress,
             aRequest, aProgressStateFlags, reqname.get()));
   }
-#endif
 
   nsCOMPtr<nsISupports> securityInfo(ExtractSecurityInfo(aRequest));
 
   nsCOMPtr<nsIURI> uri;
   nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
   if (channel) {
     channel->GetURI(getter_AddRefs(uri));
   }
@@ -684,17 +673,16 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
       // If a document loading gets triggered, we will see more events.
       return NS_OK;
     }
   }
 
   uint32_t loadFlags = 0;
   aRequest->GetLoadFlags(&loadFlags);
 
-#ifdef PR_LOGGING
   if (aProgressStateFlags & STATE_START
       &&
       aProgressStateFlags & STATE_IS_REQUEST
       &&
       isToplevelProgress
       &&
       loadFlags & nsIChannel::LOAD_DOCUMENT_URI)
   {
@@ -708,17 +696,16 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
       &&
       isToplevelProgress
       &&
       loadFlags & nsIChannel::LOAD_DOCUMENT_URI)
   {
     PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
            ("SecureUI:%p: OnStateChange: SOMETHING STOPS FOR TOPMOST DOCUMENT\n", this));
   }
-#endif
 
   bool isSubDocumentRelevant = true;
 
   // We are only interested in requests that load in the browser window...
   if (!imgRequest) { // is not imgRequest
     nsCOMPtr<nsIHttpChannel> httpRequest(do_QueryInterface(aRequest));
     if (!httpRequest) {
       nsCOMPtr<nsIFileChannel> fileRequest(do_QueryInterface(aRequest));
--- a/security/manager/boot/src/nsSecurityHeaderParser.cpp
+++ b/security/manager/boot/src/nsSecurityHeaderParser.cpp
@@ -41,27 +41,25 @@ IsQuotedTextSymbol(signed char chr) {
 }
 
 // The octet following the "\" in a quoted pair can be anything 0-127.
 bool
 IsQuotedPairSymbol(signed char chr) {
   return (chr >= 0);
 }
 
-#if defined(PR_LOGGING)
 static PRLogModuleInfo *
 GetSHParserLog()
 {
   static PRLogModuleInfo *sSHParserLog;
   if (!sSHParserLog) {
     sSHParserLog = PR_NewLogModule("nsSecurityHeaderParser");
   }
   return sSHParserLog;
 }
-#endif
 
 #define SHPARSERLOG(args) PR_LOG(GetSHParserLog(), PR_LOG_DEBUG, args)
 
 nsSecurityHeaderParser::nsSecurityHeaderParser(const char *aHeader)
   : mCursor(aHeader)
   , mError(false)
 {
 }
--- a/security/manager/boot/src/nsSiteSecurityService.cpp
+++ b/security/manager/boot/src/nsSiteSecurityService.cpp
@@ -35,26 +35,24 @@
 // influence its HSTS status via include subdomains, however).
 // This prevents the preload list from overriding the site's current
 // desired HSTS status.
 #include "nsSTSPreloadList.inc"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-#if defined(PR_LOGGING)
 static PRLogModuleInfo *
 GetSSSLog()
 {
   static PRLogModuleInfo *gSSSLog;
   if (!gSSSLog)
     gSSSLog = PR_NewLogModule("nsSSService");
   return gSSSLog;
 }
-#endif
 
 #define SSSLOG(args) PR_LOG(GetSSSLog(), 4, args)
 
 ////////////////////////////////////////////////////////////////////////////////
 
 SiteHSTSState::SiteHSTSState(nsCString& aStateString)
   : mHSTSExpireTime(0)
   , mHSTSState(SecurityPropertyUnset)
--- a/security/manager/ssl/src/PSMContentListener.cpp
+++ b/security/manager/ssl/src/PSMContentListener.cpp
@@ -21,19 +21,17 @@
 #include "mozilla/net/ChannelDiverterChild.h"
 
 #include "nsCRT.h"
 #include "nsNetUtil.h"
 #include "nsNSSHelper.h"
 
 #include "prlog.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 namespace mozilla { namespace psm {
 
 namespace {
 
 const int32_t kDefaultCertAllocLength = 2048;
 
 enum {
@@ -394,21 +392,19 @@ NS_IMETHODIMP
 PSMContentListener::DoContent(const nsACString& aContentType,
                                bool aIsContentPreferred,
                                nsIRequest* aRequest,
                                nsIStreamListener** aContentHandler,
                                bool* aAbortProcess)
 {
   uint32_t type;
   type = getPSMContentType(PromiseFlatCString(aContentType).get());
-#ifdef PR_LOGGING
   if (gPIPNSSLog) {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("PSMContentListener::DoContent\n"));
   }
-#endif
   if (type != UNKNOWN_TYPE) {
     nsCOMPtr<nsIStreamListener> downloader;
     if (XRE_GetProcessType() == GeckoProcessType_Default) {
       downloader = new PSMContentStreamListener(type);
     } else {
       downloader = static_cast<PSMContentDownloaderChild*>(
           dom::ContentChild::GetSingleton()->SendPPSMContentDownloaderConstructor(type));
     }
--- a/security/manager/ssl/src/SSLServerCertVerification.cpp
+++ b/security/manager/ssl/src/SSLServerCertVerification.cpp
@@ -128,19 +128,17 @@
 
 #include "ssl.h"
 #include "cert.h"
 #include "secerr.h"
 #include "secoidt.h"
 #include "secport.h"
 #include "sslerr.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 using namespace mozilla::pkix;
 
 namespace mozilla { namespace psm {
 
 namespace {
 
 // do not use a nsCOMPtr to avoid static initializer/destructor
--- a/security/manager/ssl/src/nsCertTree.cpp
+++ b/security/manager/ssl/src/nsCertTree.cpp
@@ -21,19 +21,17 @@
 #include "nsXPCOMCID.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 
 #include "prlog.h"
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 static NS_DEFINE_CID(kCertOverrideCID, NS_CERTOVERRIDE_CID);
 
 // treeArrayElStr
 //
 // structure used to hold map of tree.  Each thread (an organization
 // field from a cert) has an element in the array.  The numChildren field
 // stores the number of certs corresponding to that thread.
--- a/security/manager/ssl/src/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/src/nsNSSCallbacks.cpp
@@ -23,19 +23,17 @@
 #include "nsNetUtil.h"
 #include "SharedSSLState.h"
 #include "ssl.h"
 #include "sslproto.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 static void AccumulateCipherSuite(Telemetry::ID probe,
                                   const SSLChannelInfo& channelInfo);
 
 namespace {
 
 // Bits in bit mask for SSL_REASONS_FOR_NOT_FALSE_STARTING telemetry probe
 // These bits are numbered so that the least subtle issues have higher values.
@@ -329,28 +327,26 @@ SECStatus nsNSSHttpRequestSession::trySe
     result_sec_status =
       internal_send_receive_attempt(retryable_error, pPollDesc, http_response_code,
                                     http_response_content_type, http_response_headers,
                                     http_response_data, http_response_data_len);
   }
   while (retryable_error &&
          retry_count < max_retries);
 
-#ifdef PR_LOGGING
   if (retry_count > 1)
   {
     if (retryable_error)
       PR_LOG(gPIPNSSLog, PR_LOG_DEBUG,
              ("nsNSSHttpRequestSession::trySendAndReceiveFcn - still failing, giving up...\n"));
     else
       PR_LOG(gPIPNSSLog, PR_LOG_DEBUG,
              ("nsNSSHttpRequestSession::trySendAndReceiveFcn - success at attempt %d\n",
               retry_count));
   }
-#endif
 
   return result_sec_status;
 }
 
 void
 nsNSSHttpRequestSession::AddRef()
 {
   ++mRefCount;
@@ -657,23 +653,21 @@ nsHTTPListener::OnStreamComplete(nsIStre
 
   FreeLoadGroup(false);
 
   nsCOMPtr<nsIRequest> req;
   nsCOMPtr<nsIHttpChannel> hchan;
 
   nsresult rv = aLoader->GetRequest(getter_AddRefs(req));
   
-#ifdef PR_LOGGING
   if (NS_FAILED(aStatus))
   {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG,
            ("nsHTTPListener::OnStreamComplete status failed %d", aStatus));
   }
-#endif
 
   if (NS_SUCCEEDED(rv))
     hchan = do_QueryInterface(req, &rv);
 
   if (NS_SUCCEEDED(rv))
   {
     rv = hchan->GetRequestSucceeded(&mHttpRequestSucceeded);
     if (NS_FAILED(rv))
--- a/security/manager/ssl/src/nsNSSCertificate.cpp
+++ b/security/manager/ssl/src/nsNSSCertificate.cpp
@@ -48,19 +48,17 @@
 #include "secasn1.h"
 #include "secder.h"
 #include "ssl.h"
 #include "plbase64.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 // This is being stored in an uint32_t that can otherwise
 // only take values from nsIX509Cert's list of cert types.
 // As nsIX509Cert is frozen, we choose a value not contained
 // in the list to mean not yet initialized.
 #define CERT_TYPE_NOT_YET_INITIALIZED (1 << 30)
 
 NS_IMPL_ISUPPORTS(nsNSSCertificate,
--- a/security/manager/ssl/src/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp
@@ -46,19 +46,17 @@
 #include "secder.h"
 #include "ssl.h"
 #include "plbase64.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 using mozilla::psm::SharedSSLState;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 static nsresult
 attemptToLogInWithDefaultPassword()
 {
 #ifdef NSS_DISABLE_DBM
   // The SQL NSS DB requires the user to be authenticated to set certificate
   // trust settings, even if the user's password is empty. To maintain
   // compatibility with the DBM-based database, try to log in with the
--- a/security/manager/ssl/src/nsNSSComponent.cpp
+++ b/security/manager/ssl/src/nsNSSComponent.cpp
@@ -54,19 +54,17 @@
 #include "nsILocalFileWin.h"
 #endif
 
 #include "p12plcy.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gPIPNSSLog = nullptr;
-#endif
 
 int nsNSSComponent::mInstanceCount = 0;
 
 bool nsPSMInitPanic::isPanic = false;
 
 // This function can be called from chrome or content processes
 // to ensure that NSS is initialized.
 bool EnsureNSSInitializedChromeOrContent()
@@ -213,20 +211,18 @@ GetOCSPBehaviorFromPrefs(/*out*/ CertVer
 nsNSSComponent::nsNSSComponent()
   :mutex("nsNSSComponent.mutex"),
    mNSSInitialized(false),
 #ifndef MOZ_NO_SMART_CARDS
    mThreadList(nullptr),
 #endif
    mCertVerificationThread(nullptr)
 {
-#ifdef PR_LOGGING
   if (!gPIPNSSLog)
     gPIPNSSLog = PR_NewLogModule("pipnss");
-#endif
   PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent::ctor\n"));
   mObserversRegistered = false;
 
   NS_ASSERTION( (0 == mInstanceCount), "nsNSSComponent is a singleton, but instantiated multiple times!");
   ++mInstanceCount;
   mShutdownObjectList = nsNSSShutDownList::construct();
   mIsNetworkDown = false;
 }
--- a/security/manager/ssl/src/nsNSSIOLayer.cpp
+++ b/security/manager/ssl/src/nsNSSIOLayer.cpp
@@ -78,19 +78,17 @@ typedef enum {ASK, AUTO} SSM_UserCertCho
 // order to false start, as a compatibility hack to work around
 // implementations that just stop responding during false start. However, now
 // false start is resricted to modern crypto (TLS 1.2 and AEAD cipher suites)
 // so it is less likely that requring NPN or ALPN is still necessary.
 static const bool FALSE_START_REQUIRE_NPN_DEFAULT = false;
 
 } // unnamed namespace
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 nsNSSSocketInfo::nsNSSSocketInfo(SharedSSLState& aState, uint32_t providerFlags)
   : mFd(nullptr),
     mCertVerificationState(before_cert_verification),
     mSharedState(aState),
     mForSTARTTLS(false),
     mHandshakePending(true),
     mRememberClientAuthCertificate(false),
--- a/security/manager/ssl/src/nsNSSShutDown.cpp
+++ b/security/manager/ssl/src/nsNSSShutDown.cpp
@@ -2,19 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsNSSShutDown.h"
 #include "nsCOMPtr.h"
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 struct ObjectHashEntry : PLDHashEntryHdr {
   nsNSSShutDownObject *obj;
 };
 
 static bool
 ObjectSetMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
                          const void *key)
--- a/security/manager/ssl/src/nsNTLMAuthModule.cpp
+++ b/security/manager/ssl/src/nsNTLMAuthModule.cpp
@@ -24,31 +24,27 @@
 #include "nsNSSShutDown.h"
 #include "nsUnicharUtils.h"
 #include "pk11pub.h"
 #include "prlog.h"
 #include "prsystem.h"
 
 static bool sNTLMv1Forced = false;
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo *
 GetNTLMLog()
 {
   static PRLogModuleInfo *sNTLMLog;
   if (!sNTLMLog)
     sNTLMLog = PR_NewLogModule("NTLM");
   return sNTLMLog;
 }
 
 #define LOG(x) PR_LOG(GetNTLMLog(), PR_LOG_DEBUG, x)
 #define LOG_ENABLED() PR_LOG_TEST(GetNTLMLog(), PR_LOG_DEBUG)
-#else
-#define LOG(x)
-#endif
 
 static void des_makekey(const uint8_t *raw, uint8_t *key);
 static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash);
 
 //-----------------------------------------------------------------------------
 // this file contains a cross-platform NTLM authentication implementation. it
 // is based on documentation from: http://davenport.sourceforge.net/ntlm.html
 //-----------------------------------------------------------------------------
@@ -114,18 +110,16 @@ static const char NTLM_TYPE3_MARKER[] = 
 #define NTLM_HASH_LEN 16
 #define NTLMv2_HASH_LEN 16
 #define NTLM_RESP_LEN 24
 #define NTLMv2_RESP_LEN 16
 #define NTLMv2_BLOB1_LEN 28
 
 //-----------------------------------------------------------------------------
 
-#ifdef PR_LOGGING
-
 /**
  * Prints a description of flags to the NSPR Log, if enabled.
  */
 static void LogFlags(uint32_t flags)
 {
   if (!LOG_ENABLED())
     return;
 #define TEST(_flag) \
@@ -235,23 +229,16 @@ static void LogToken(const char *name, c
   char *b64data = PL_Base64Encode((const char *) token, tokenLen, nullptr);
   if (b64data)
   {
     PR_LogPrint("%s: %s\n", name, b64data);
     PR_Free(b64data);
   }
 }
 
-#else
-#define LogFlags(x)
-#define LogBuf(a,b,c)
-#define LogToken(a,b,c)
-
-#endif // PR_LOGGING
-
 //-----------------------------------------------------------------------------
 
 // byte order swapping
 #define SWAP16(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
 #define SWAP32(x) ((SWAP16((x) & 0xffff) << 16) | (SWAP16((x) >> 16)))
 
 static void *
 WriteBytes(void *buf, const void *data, uint32_t dataLen)
@@ -1051,20 +1038,18 @@ nsNTLMAuthModule::GetNextToken(const voi
     } else {
       rv = GenerateType1Msg(outToken, outTokenLen);
       if (NS_SUCCEEDED(rv)) {
 	mNTLMNegotiateSent = true;
       }
     }
   }
 
-#ifdef PR_LOGGING
   if (NS_SUCCEEDED(rv))
     LogToken("out-token", *outToken, *outTokenLen);
-#endif
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsNTLMAuthModule::Unwrap(const void *inToken,
                         uint32_t    inTokenLen,
                         void      **outToken,
--- a/security/manager/ssl/src/nsPK11TokenDB.cpp
+++ b/security/manager/ssl/src/nsPK11TokenDB.cpp
@@ -9,19 +9,17 @@
 #include "prerror.h"
 #include "secerr.h"
 #include "nsReadableUtils.h"
 #include "nsNSSComponent.h"
 #include "nsServiceManagerUtils.h"
 
 #include "nsPK11TokenDB.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 NS_IMPL_ISUPPORTS(nsPK11Token, nsIPK11Token)
 
 nsPK11Token::nsPK11Token(PK11SlotInfo *slot)
 {
   nsNSSShutDownPreventionLock locker;
   if (isAlreadyShutDown())
     return;
--- a/security/manager/ssl/src/nsPKCS11Slot.cpp
+++ b/security/manager/ssl/src/nsPKCS11Slot.cpp
@@ -8,19 +8,17 @@
 #include "nsCOMPtr.h"
 #include "nsISupportsArray.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 
 #include "secmod.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 NS_IMPL_ISUPPORTS(nsPKCS11Slot, nsIPKCS11Slot)
 
 nsPKCS11Slot::nsPKCS11Slot(PK11SlotInfo *slot)
 {
   nsNSSShutDownPreventionLock locker;
   if (isAlreadyShutDown())
     return;
--- a/security/manager/ssl/src/nsPKCS12Blob.cpp
+++ b/security/manager/ssl/src/nsPKCS12Blob.cpp
@@ -26,19 +26,17 @@
 #include "nsKeygenHandler.h" //For GetSlotWithMechanism
 #include "nsPK11TokenDB.h"
 #include "nsICertificateDialogs.h"
 #include "nsNSSShutDown.h"
 #include "nsCRT.h"
 
 #include "secerr.h"
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 using namespace mozilla;
 
 #define PIP_PKCS12_TMPFILENAME   NS_LITERAL_CSTRING(".pip_p12tmp")
 #define PIP_PKCS12_BUFFER_SIZE   2048
 #define PIP_PKCS12_RESTORE_OK          1
 #define PIP_PKCS12_BACKUP_OK           2
 #define PIP_PKCS12_USER_CANCELED       3
--- a/security/manager/ssl/src/nsUsageArrayHelper.cpp
+++ b/security/manager/ssl/src/nsUsageArrayHelper.cpp
@@ -14,19 +14,17 @@
 #include "nsServiceManagerUtils.h"
 #include "nspr.h"
 #include "pkix/pkixnss.h"
 #include "secerr.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
-#endif
 
 static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); // XXX? needed?::
 
 nsUsageArrayHelper::nsUsageArrayHelper(CERTCertificate *aCert)
 :mCert(aCert)
 {
   nsNSSShutDownPreventionLock locker;
   defaultcertdb = CERT_GetDefaultCertDB();