Bug 579517 follow-up: Remove NSPR types that crept in
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 06 Sep 2012 10:11:28 -0400
changeset 104465 42777635165aa643095462b12975fe18896d4bb4
parent 104464 c12db325f86338c1ba930d01205d1be21d919cc7
child 104466 0ee117877c93638147dd8e516e13e3603bf469fa
push id14506
push usereakhgari@mozilla.com
push dateThu, 06 Sep 2012 14:12:55 +0000
treeherdermozilla-inbound@42777635165a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs579517
milestone18.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 579517 follow-up: Remove NSPR types that crept in
accessible/src/generic/Accessible.cpp
content/svg/content/src/nsSVGSVGElement.cpp
content/svg/content/src/nsSVGSVGElement.h
dom/bluetooth/BluetoothService.h
dom/plugins/base/nsPluginTags.h
image/src/imgLoader.cpp
image/src/imgLoader.h
layout/generic/nsSimplePageSequence.cpp
layout/generic/nsSimplePageSequence.h
layout/printing/nsPrintEngine.cpp
layout/svg/base/src/nsSVGOuterSVGFrame.cpp
toolkit/components/mediasniffer/nsMediaSniffer.cpp
toolkit/components/mediasniffer/nsMediaSniffer.h
--- a/accessible/src/generic/Accessible.cpp
+++ b/accessible/src/generic/Accessible.cpp
@@ -2847,18 +2847,18 @@ bool
 Accessible::IsActiveWidget() const
 {
   if (FocusMgr()->HasDOMFocus(mContent))
     return true;
 
   // If text entry of combobox widget has a focus then the combobox widget is
   // active.
   if (mRoleMapEntry && mRoleMapEntry->Is(nsGkAtoms::combobox)) {
-    PRUint32 childCount = ChildCount();
-    for (PRUint32 idx = 0; idx < childCount; idx++) {
+    uint32_t childCount = ChildCount();
+    for (uint32_t idx = 0; idx < childCount; idx++) {
       Accessible* child = mChildren.ElementAt(idx);
       if (child->Role() == roles::ENTRY)
         return FocusMgr()->HasDOMFocus(child->GetContent());
     }
   }
 
   return false;
 }
--- a/content/svg/content/src/nsSVGSVGElement.cpp
+++ b/content/svg/content/src/nsSVGSVGElement.cpp
@@ -929,17 +929,17 @@ nsSVGSVGElement::GetViewBoxTransform() c
   return nsSVGUtils::GetViewBoxTransform(this,
                                          viewportWidth, viewportHeight,
                                          viewBox.x, viewBox.y,
                                          viewBox.width, viewBox.height,
                                          GetPreserveAspectRatioWithOverride());
 }
 
 void
-nsSVGSVGElement::ChildrenOnlyTransformChanged(PRUint32 aFlags)
+nsSVGSVGElement::ChildrenOnlyTransformChanged(uint32_t aFlags)
 {
   // Avoid wasteful calls:
   NS_ABORT_IF_FALSE(!(GetPrimaryFrame()->GetStateBits() &
                       NS_STATE_SVG_NONDISPLAY_CHILD),
                     "Non-display SVG frames don't maintain overflow rects");
 
   nsChangeHint changeHint;
 
--- a/content/svg/content/src/nsSVGSVGElement.h
+++ b/content/svg/content/src/nsSVGSVGElement.h
@@ -219,17 +219,17 @@ public:
    * immediate childrens' frames need to be updated. It is called by our own
    * frame when changes (e.g. to currentScale) cause our children-only
    * transform to change.
    *
    * The reason we have this method instead of overriding
    * GetAttributeChangeHint is because we need to act on non-attribute (e.g.
    * currentScale) changes in addition to attribute (e.g. viewBox) changes.
    */
-  void ChildrenOnlyTransformChanged(PRUint32 aFlags = 0);
+  void ChildrenOnlyTransformChanged(uint32_t aFlags = 0);
 
   // This services any pending notifications for the transform on on this root
   // <svg> node needing to be recalculated.  (Only applicable in
   // SVG-as-an-image documents.)
   virtual void FlushImageTransformInvalidation();
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
--- a/dom/bluetooth/BluetoothService.h
+++ b/dom/bluetooth/BluetoothService.h
@@ -192,17 +192,17 @@ public:
    *
    * @return True if path set correctly, false otherwise
    */
   virtual bool
   GetDevicePath(const nsAString& aAdapterPath,
                 const nsAString& aDeviceAddress,
                 nsAString& aDevicePath) = 0;
 
-  virtual nsTArray<PRUint32>
+  virtual nsTArray<uint32_t>
   AddReservedServicesInternal(const nsAString& aAdapterPath,
                               const nsTArray<uint32_t>& aServices) = 0;
 
   virtual bool
   RemoveReservedServicesInternal(const nsAString& aAdapterPath,
                                  const nsTArray<uint32_t>& aServiceHandles) = 0;
 
   virtual nsresult
--- a/dom/plugins/base/nsPluginTags.h
+++ b/dom/plugins/base/nsPluginTags.h
@@ -87,17 +87,17 @@ private:
                 uint32_t aVariantCount);
   nsresult EnsureMembersAreUTF8();
 };
 
 class DOMMimeTypeImpl : public nsIDOMMimeType {
 public:
   NS_DECL_ISUPPORTS
 
-  DOMMimeTypeImpl(nsPluginTag* aTag, PRUint32 aMimeTypeIndex)
+  DOMMimeTypeImpl(nsPluginTag* aTag, uint32_t aMimeTypeIndex)
   {
     if (!aTag)
       return;
     CopyUTF8toUTF16(aTag->mMimeDescriptions[aMimeTypeIndex], mDescription);
     CopyUTF8toUTF16(aTag->mExtensions[aMimeTypeIndex], mSuffixes);
     CopyUTF8toUTF16(aTag->mMimeTypes[aMimeTypeIndex], mType);
   }
 
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -83,17 +83,17 @@ public:
   }
 
   NS_IMETHOD CollectReports(nsIMemoryMultiReporterCallback *callback,
                             nsISupports *closure)
   {
     AllSizes chrome;
     AllSizes content;
 
-    for (PRUint32 i = 0; i < mKnownLoaders.Length(); i++) {
+    for (uint32_t i = 0; i < mKnownLoaders.Length(); i++) {
       mKnownLoaders[i]->mChromeCache.EnumerateRead(EntryAllSizes, &chrome);
       mKnownLoaders[i]->mCache.EnumerateRead(EntryAllSizes, &content);
     }
 
 #define REPORT(_path, _kind, _amount, _desc)                                  \
     do {                                                                      \
       nsresult rv;                                                            \
       rv = callback->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path),      \
@@ -153,28 +153,28 @@ public:
 #undef REPORT
 
     return NS_OK;
   }
 
   NS_IMETHOD GetExplicitNonHeap(int64_t *n)
   {
     size_t n2 = 0;
-    for (PRUint32 i = 0; i < mKnownLoaders.Length(); i++) {
+    for (uint32_t i = 0; i < mKnownLoaders.Length(); i++) {
       mKnownLoaders[i]->mChromeCache.EnumerateRead(EntryExplicitNonHeapSize, &n2);
       mKnownLoaders[i]->mCache.EnumerateRead(EntryExplicitNonHeapSize, &n2);
     }
     *n = n2;
     return NS_OK;
   }
 
   static int64_t GetImagesContentUsedUncompressed()
   {
     size_t n = 0;
-    for (PRUint32 i = 0; i < imgLoader::sMemReporter->mKnownLoaders.Length(); i++) {
+    for (uint32_t i = 0; i < imgLoader::sMemReporter->mKnownLoaders.Length(); i++) {
       imgLoader::sMemReporter->mKnownLoaders[i]->mCache.EnumerateRead(EntryUsedUncompressedSize, &n);
     }
     return n;
   }
 
   void RegisterLoader(imgLoader* aLoader)
   {
     mKnownLoaders.AppendElement(aLoader);
--- a/image/src/imgLoader.h
+++ b/image/src/imgLoader.h
@@ -317,17 +317,17 @@ private: // methods
 
   typedef nsRefPtrHashtable<nsCStringHashKey, imgCacheEntry> imgCacheTable;
 
   nsresult EvictEntries(imgCacheTable &aCacheToClear);
   nsresult EvictEntries(imgCacheQueue &aQueueToClear);
 
   imgCacheTable &GetCache(nsIURI *aURI);
   imgCacheQueue &GetCacheQueue(nsIURI *aURI);
-  void CacheEntriesChanged(nsIURI *aURI, PRInt32 sizediff = 0);
+  void CacheEntriesChanged(nsIURI *aURI, int32_t sizediff = 0);
   void CheckCacheLimits(imgCacheTable &cache, imgCacheQueue &queue);
 
 private: // data
   friend class imgCacheEntry;
   friend class imgMemoryReporter;
 
   imgCacheTable mCache;
   imgCacheQueue mCacheQueue;
--- a/layout/generic/nsSimplePageSequence.cpp
+++ b/layout/generic/nsSimplePageSequence.cpp
@@ -629,17 +629,17 @@ nsSimplePageSequenceFrame::PrePrintNextP
       nsRefPtr<nsRenderingContext> renderingContext;
       dc->CreateRenderingContext(*getter_AddRefs(renderingContext));
       NS_ENSURE_TRUE(renderingContext, NS_ERROR_OUT_OF_MEMORY);
 
       nsRefPtr<gfxASurface> renderingSurface =
           renderingContext->ThebesContext()->CurrentSurface();
       NS_ENSURE_TRUE(renderingSurface, NS_ERROR_OUT_OF_MEMORY);
 
-      for (PRInt32 i = mCurrentCanvasList.Length() - 1; i >= 0 ; i--) {
+      for (int32_t i = mCurrentCanvasList.Length() - 1; i >= 0 ; i--) {
         nsHTMLCanvasElement* canvas = mCurrentCanvasList[i];
         nsIntSize size = canvas->GetSize();
 
         nsRefPtr<gfxASurface> printSurface = renderingSurface->
            CreateSimilarSurface(
              gfxASurface::CONTENT_COLOR_ALPHA,
              size
            );
@@ -655,47 +655,47 @@ nsSimplePageSequenceFrame::PrePrintNextP
 
         // Start the rendering process.
         nsWeakFrame weakFrame = this;
         canvas->DispatchPrintCallback(aCallback);
         NS_ENSURE_STATE(weakFrame.IsAlive());
       }
     }
   }
-  PRInt32 doneCounter = 0;
-  for (PRInt32 i = mCurrentCanvasList.Length() - 1; i >= 0 ; i--) {
+  int32_t doneCounter = 0;
+  for (int32_t i = mCurrentCanvasList.Length() - 1; i >= 0 ; i--) {
     nsHTMLCanvasElement* canvas = mCurrentCanvasList[i];
 
     if (canvas->IsPrintCallbackDone()) {
       doneCounter++;
     }
   }
   // If all canvas have finished rendering, return true, otherwise false.
   *aDone = doneCounter == mCurrentCanvasList.Length();
 
   return NS_OK;
 }
 
 void
 nsSimplePageSequenceFrame::InvalidateInternal(const nsRect& aDamageRect,
                                               nscoord aX, nscoord aY,
                                               nsIFrame* aForChild,
-                                              PRUint32 aFlags)
+                                              uint32_t aFlags)
 {
   // xxx Invalidate the entire frame as otherwise invalidate of printCanvas
   // don't work properly. This is hopefully no longer necessary once 539356
   // lands.
   nsContainerFrame::InvalidateInternal(
       nsRect(nsPoint(0,0), GetSize()), 0, 0, aForChild, aFlags); 
 }
 
 NS_IMETHODIMP
 nsSimplePageSequenceFrame::ResetPrintCanvasList()
 {
-  for (PRInt32 i = mCurrentCanvasList.Length() - 1; i >= 0 ; i--) {
+  for (int32_t i = mCurrentCanvasList.Length() - 1; i >= 0 ; i--) {
     nsHTMLCanvasElement* canvas = mCurrentCanvasList[i];
     canvas->ResetPrintCallback();
   }
 
   mCurrentCanvasList.Clear();
   mCurrentCanvasListSetup = false; 
   return NS_OK;
 } 
--- a/layout/generic/nsSimplePageSequence.h
+++ b/layout/generic/nsSimplePageSequence.h
@@ -95,17 +95,17 @@ public:
    *
    * @see nsGkAtoms::sequenceFrame
    */
   virtual nsIAtom* GetType() const;
 
   virtual void InvalidateInternal(const nsRect& aDamageRect,
                                   nscoord aX, nscoord aY,
                                   nsIFrame* aForChild,
-                                  PRUint32 aFlags);
+                                  uint32_t aFlags);
 #ifdef DEBUG
   NS_IMETHOD  GetFrameName(nsAString& aResult) const;
 #endif
 
   void PaintPageSequence(nsRenderingContext& aRenderingContext,
                          const nsRect&        aDirtyRect,
                          nsPoint              aPt);
 
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -2398,18 +2398,18 @@ DocHasPrintCallbackCanvas(nsIDocument* a
 {
   if (!aDoc) {
     return true;
   }
   Element* root = aDoc->GetRootElement();
   nsRefPtr<nsContentList> canvases = NS_GetContentList(root,
                                                        kNameSpaceID_XHTML,
                                                        NS_LITERAL_STRING("canvas"));
-  PRUint32 canvasCount = canvases->Length(true);
-  for (PRUint32 i = 0; i < canvasCount; ++i) {
+  uint32_t canvasCount = canvases->Length(true);
+  for (uint32_t i = 0; i < canvasCount; ++i) {
     nsCOMPtr<nsIDOMHTMLCanvasElement> canvas = do_QueryInterface(canvases->Item(i, false));
     nsCOMPtr<nsIPrintCallback> printCallback;
     if (canvas && NS_SUCCEEDED(canvas->GetMozPrintCallback(getter_AddRefs(printCallback))) &&
         printCallback) {
       // This subdocument has a print callback. Set result and return false to
       // stop iteration.
       *static_cast<bool*>(aData) = true;
       return false;
--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
@@ -721,17 +721,17 @@ nsSVGOuterSVGFrame::NotifyViewportOrTran
   }
 
   if (aFlags & TRANSFORM_CHANGED) {
     // Make sure our canvas transform matrix gets (lazily) recalculated:
     mCanvasTM = nullptr;
 
     if (haveNonFulLZoomTransformChange &&
         !(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
-      PRUint32 flags = (mState & NS_FRAME_IN_REFLOW) ?
+      uint32_t flags = (mState & NS_FRAME_IN_REFLOW) ?
                          nsSVGSVGElement::eDuringReflow : 0;
       content->ChildrenOnlyTransformChanged(flags);
     }
   }
 
   nsSVGUtils::NotifyChildrenOfSVGChange(GetFirstPrincipalChild(), aFlags);
 }
 
--- a/toolkit/components/mediasniffer/nsMediaSniffer.cpp
+++ b/toolkit/components/mediasniffer/nsMediaSniffer.cpp
@@ -11,17 +11,17 @@
 #include "nsMimeTypes.h"
 #include "mozilla/ModuleUtils.h"
 
 #include "nsIClassInfoImpl.h"
 
 // The minimum number of bytes that are needed to attempt to sniff an mp4 file.
 static const unsigned MP4_MIN_BYTES_COUNT = 12;
 // The maximum number of bytes to consider when attempting to sniff a file.
-static const PRUint32 MAX_BYTES_SNIFFED = 512;
+static const uint32_t MAX_BYTES_SNIFFED = 512;
 
 NS_IMPL_ISUPPORTS1(nsMediaSniffer, nsIContentSniffer)
 
 nsMediaSniffer::nsMediaSnifferEntry nsMediaSniffer::sSnifferEntries[] = {
   // The string OggS, followed by the null byte.
   PATTERN_ENTRY("\xFF\xFF\xFF\xFF\xFF", "OggS", APPLICATION_OGG),
   // The string RIFF, followed by four bytes, followed by the string WAVE
   PATTERN_ENTRY("\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF", "RIFF\x00\x00\x00\x00WAVE", AUDIO_WAV),
@@ -30,64 +30,64 @@ nsMediaSniffer::nsMediaSnifferEntry nsMe
   // mp3 without ID3 tags.
   PATTERN_ENTRY("\xFF\xFB", "\xFF\xFA", AUDIO_MP3),
   // mp3 with ID3 tags, the string "ID3".
   PATTERN_ENTRY("\xFF\xFF\xFF", "ID3", AUDIO_MP3)
 };
 
 // This function implements mp4 sniffing algorithm, described at
 // http://mimesniff.spec.whatwg.org/#signature-for-mp4
-static bool MatchesMP4(const PRUint8* aData, const PRUint32 aLength)
+static bool MatchesMP4(const uint8_t* aData, const uint32_t aLength)
 {
   if (aLength <= MP4_MIN_BYTES_COUNT) {
     return false;
   }
   // Conversion from big endian to host byte order.
-  PRUint32 boxSize = (PRUint32)(aData[3] | aData[2] << 8 | aData[1] << 16 | aData[0] << 24);
+  uint32_t boxSize = (uint32_t)(aData[3] | aData[2] << 8 | aData[1] << 16 | aData[0] << 24);
 
   // Boxsize should be evenly divisible by 4.
   if (boxSize % 4 || aLength < boxSize) {
     return false;
   }
   // The string "ftyp".
   if (aData[4] != 0x66 ||
       aData[5] != 0x74 ||
       aData[6] != 0x79 ||
       aData[7] != 0x70) {
     return false;
   }
-  for (PRUint32 i = 2; i <= boxSize / 4 - 1 ; i++) {
+  for (uint32_t i = 2; i <= boxSize / 4 - 1 ; i++) {
     if (i == 3) {
       continue;
     }
     // The string "mp4".
     if (aData[4*i]   == 0x6D &&
         aData[4*i+1] == 0x70 &&
         aData[4*i+2] == 0x34) {
       return true;
     }
   }
   return false;
 }
 
 NS_IMETHODIMP
 nsMediaSniffer::GetMIMETypeFromContent(nsIRequest* aRequest,
-                                       const PRUint8* aData,
-                                       const PRUint32 aLength,
+                                       const uint8_t* aData,
+                                       const uint32_t aLength,
                                        nsACString& aSniffedType)
 {
-  const PRUint32 clampedLength = NS_MIN(aLength, MAX_BYTES_SNIFFED);
+  const uint32_t clampedLength = NS_MIN(aLength, MAX_BYTES_SNIFFED);
 
-  for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sSnifferEntries); ++i) {
+  for (uint32_t i = 0; i < NS_ARRAY_LENGTH(sSnifferEntries); ++i) {
     const nsMediaSnifferEntry& currentEntry = sSnifferEntries[i];
     if (clampedLength < currentEntry.mLength || currentEntry.mLength == 0) {
       continue;
     }
     bool matched = true;
-    for (PRUint32 j = 0; j < currentEntry.mLength; ++j) {
+    for (uint32_t j = 0; j < currentEntry.mLength; ++j) {
       if ((currentEntry.mMask[j] & aData[j]) != currentEntry.mPattern[j]) {
         matched = false;
         break;
       }
     }
     if (matched) {
       aSniffedType.AssignASCII(currentEntry.mContentType);
       return NS_OK;
--- a/toolkit/components/mediasniffer/nsMediaSniffer.h
+++ b/toolkit/components/mediasniffer/nsMediaSniffer.h
@@ -23,19 +23,19 @@ class nsMediaSniffer : public nsIContent
 {
   public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSICONTENTSNIFFER
   protected:
     ~nsMediaSniffer() {};
 
 #define PATTERN_ENTRY(mask, pattern, contentType) \
-    {(const PRUint8*)mask, (const PRUint8*)pattern, sizeof(mask) - 1, contentType}
+    {(const uint8_t*)mask, (const uint8_t*)pattern, sizeof(mask) - 1, contentType}
 
   struct nsMediaSnifferEntry {
-    const PRUint8* mMask;
-    const PRUint8* mPattern;
-    const PRUint32 mLength;
+    const uint8_t* mMask;
+    const uint8_t* mPattern;
+    const uint32_t mLength;
     const char* mContentType;
   };
 
   static nsMediaSnifferEntry sSnifferEntries[];
 };