Bug 579517 follow-up: Remove NSPR types that crept in
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 08 Aug 2014 08:39:07 -0400
changeset 198606 e0c00c1861af255cc20060c69e30bb8595dd00b3
parent 198605 9cc8465f45a52557bcd38f5b3348780b147ab1c4
child 198607 735394aa3813f82e16ace2333ff406b4f1c012a7
push idunknown
push userunknown
push dateunknown
bugs579517
milestone34.0a1
Bug 579517 follow-up: Remove NSPR types that crept in
chrome/nsChromeRegistryChrome.cpp
content/base/src/nsCrossSiteListenerProxy.cpp
content/media/webrtc/MediaEngineDefault.cpp
dom/media/MediaManager.cpp
dom/workers/RuntimeService.cpp
security/apps/AppTrustDomain.cpp
security/certverifier/NSSCertDBTrustDomain.cpp
--- a/chrome/nsChromeRegistryChrome.cpp
+++ b/chrome/nsChromeRegistryChrome.cpp
@@ -491,17 +491,17 @@ nsChromeRegistryChrome::SendRegisteredCh
                                                mSelectedLocale, false);
     NS_ENSURE_TRUE_VOID(success);
   } else {
     nsTArray<ContentParent*> parents;
     ContentParent::GetAll(parents);
     if (!parents.Length())
       return;
 
-    for (PRUint32 i = 0; i < parents.Length(); i++) {
+    for (uint32_t i = 0; i < parents.Length(); i++) {
       DebugOnly<bool> success =
         parents[i]->SendRegisterChrome(packages, resources, overrides,
                                        mSelectedLocale, true);
       NS_WARN_IF_FALSE(success, "couldn't reset a child's registered chrome");
     }
   }
 }
 
--- a/content/base/src/nsCrossSiteListenerProxy.cpp
+++ b/content/base/src/nsCrossSiteListenerProxy.cpp
@@ -42,17 +42,17 @@ static bool gDisableCORS = false;
 static bool gDisableCORSPrivateData = false;
 
 static nsresult
 LogBlockedRequest(nsIRequest* aRequest)
 {
   nsresult rv = NS_OK;
 
   // Get the innerWindowID associated with the XMLHTTPRequest
-  PRUint64 innerWindowID = 0;
+  uint64_t innerWindowID = 0;
 
   nsCOMPtr<nsILoadGroup> loadGroup;
   aRequest->GetLoadGroup(getter_AddRefs(loadGroup));
   if (loadGroup) {
     nsCOMPtr<nsIInterfaceRequestor> callbacks;
     loadGroup->GetNotificationCallbacks(getter_AddRefs(callbacks));
     if (callbacks) {
       nsCOMPtr<nsILoadContext> loadContext = do_GetInterface(callbacks);
--- a/content/media/webrtc/MediaEngineDefault.cpp
+++ b/content/media/webrtc/MediaEngineDefault.cpp
@@ -187,17 +187,17 @@ MediaEngineDefaultVideoSource::Snapshot(
   nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES, "Browse", title);
   int16_t mode = static_cast<int16_t>(nsIFilePicker::modeOpen);
 
   nsresult rv = filePicker->Init(nullptr, title, mode);
   NS_ENSURE_SUCCESS(rv, rv);
   filePicker->AppendFilters(nsIFilePicker::filterImages);
 
   // XXX - This API should be made async
-  PRInt16 dialogReturn;
+  int16_t dialogReturn;
   rv = filePicker->Show(&dialogReturn);
   NS_ENSURE_SUCCESS(rv, rv);
   if (dialogReturn == nsIFilePicker::returnCancel) {
     *aFile = nullptr;
     return NS_OK;
   }
 
   nsCOMPtr<nsIFile> localFile;
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -125,27 +125,27 @@ HostHasPermission(nsIURI &docURI)
   nsresult rv;
   // Get UTF8 to ASCII domain name normalization service
   nsCOMPtr<nsIIDNService> idnService
     = do_GetService("@mozilla.org/network/idn-service;1", &rv);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
-  PRUint32 begin = 0;
-  PRUint32 end = 0;
+  uint32_t begin = 0;
+  uint32_t end = 0;
   nsCString domainName;
   /* 
      Test each domain name in the comma separated list
      after converting from UTF8 to ASCII. Each domain
      must match exactly: no wildcards are used.
   */
   do {
     end = domainWhiteList.FindChar(',', begin);
-    if (end == (PRUint32)-1) {
+    if (end == (uint32_t)-1) {
       // Last or only domain name in the comma separated list
       end = domainWhiteList.Length();
     }
 
     rv = idnService->ConvertUTF8toACE(Substring(domainWhiteList, begin, end - begin),
                                       domainName);
     if (NS_SUCCEEDED(rv)) {
       if (hostName.EqualsIgnoreCase(domainName.Data(), domainName.Length())) {
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -1091,17 +1091,17 @@ public:
 #ifdef ENABLE_TESTS
   void
   TestPBackground()
   {
     using namespace mozilla::ipc;
     if (gTestPBackground) {
       // Randomize value to validate workers are not cross-posting messages.
       uint32_t testValue;
-      PRSize randomSize = PR_GetRandomNoise(&testValue, sizeof(testValue));
+      size_t randomSize = PR_GetRandomNoise(&testValue, sizeof(testValue));
       MOZ_RELEASE_ASSERT(randomSize == sizeof(testValue));
       nsCString testStr;
       testStr.AppendInt(testValue);
       testStr.AppendInt(reinterpret_cast<int64_t>(PR_GetCurrentThread()));
       PBackgroundChild* existingBackgroundChild =
         BackgroundChild::GetForCurrentThread();
       MOZ_RELEASE_ASSERT(existingBackgroundChild);
       bool ok = existingBackgroundChild->SendPBackgroundTestConstructor(testStr);
--- a/security/apps/AppTrustDomain.cpp
+++ b/security/apps/AppTrustDomain.cpp
@@ -167,24 +167,24 @@ AppTrustDomain::GetCertTrust(EndEntityOr
     CERT_NewTempCertificate(CERT_GetDefaultCertDB(), &candidateCertDERSECItem,
                             nullptr, false, true));
   if (!candidateCert) {
     return MapPRErrorCodeToResult(PR_GetError());
   }
 
   CERTCertTrust trust;
   if (CERT_GetCertTrust(candidateCert.get(), &trust) == SECSuccess) {
-    PRUint32 flags = SEC_GET_TRUST_FLAGS(&trust, trustObjectSigning);
+    uint32_t flags = SEC_GET_TRUST_FLAGS(&trust, trustObjectSigning);
 
     // For DISTRUST, we use the CERTDB_TRUSTED or CERTDB_TRUSTED_CA bit,
     // because we can have active distrust for either type of cert. Note that
     // CERTDB_TERMINAL_RECORD means "stop trying to inherit trust" so if the
     // relevant trust bit isn't set then that means the cert must be considered
     // distrusted.
-    PRUint32 relevantTrustBit = endEntityOrCA == EndEntityOrCA::MustBeCA
+    uint32_t relevantTrustBit = endEntityOrCA == EndEntityOrCA::MustBeCA
                               ? CERTDB_TRUSTED_CA
                               : CERTDB_TRUSTED;
     if (((flags & (relevantTrustBit | CERTDB_TERMINAL_RECORD)))
             == CERTDB_TERMINAL_RECORD) {
       trustLevel = TrustLevel::ActivelyDistrusted;
       return Success;
     }
   }
--- a/security/certverifier/NSSCertDBTrustDomain.cpp
+++ b/security/certverifier/NSSCertDBTrustDomain.cpp
@@ -177,24 +177,24 @@ NSSCertDBTrustDomain::GetCertTrust(EndEn
 
   // XXX: CERT_GetCertTrust seems to be abusing SECStatus as a boolean, where
   // SECSuccess means that there is a trust record and SECFailure means there
   // is not a trust record. I looked at NSS's internal uses of
   // CERT_GetCertTrust, and all that code uses the result as a boolean meaning
   // "We have a trust record."
   CERTCertTrust trust;
   if (CERT_GetCertTrust(candidateCert.get(), &trust) == SECSuccess) {
-    PRUint32 flags = SEC_GET_TRUST_FLAGS(&trust, mCertDBTrustType);
+    uint32_t flags = SEC_GET_TRUST_FLAGS(&trust, mCertDBTrustType);
 
     // For DISTRUST, we use the CERTDB_TRUSTED or CERTDB_TRUSTED_CA bit,
     // because we can have active distrust for either type of cert. Note that
     // CERTDB_TERMINAL_RECORD means "stop trying to inherit trust" so if the
     // relevant trust bit isn't set then that means the cert must be considered
     // distrusted.
-    PRUint32 relevantTrustBit =
+    uint32_t relevantTrustBit =
       endEntityOrCA == EndEntityOrCA::MustBeCA ? CERTDB_TRUSTED_CA
                                                : CERTDB_TRUSTED;
     if (((flags & (relevantTrustBit|CERTDB_TERMINAL_RECORD)))
             == CERTDB_TERMINAL_RECORD) {
       trustLevel = TrustLevel::ActivelyDistrusted;
       return Success;
     }