Bug 579517 follow-up: Remove NSPR types that crept in
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 07 Oct 2012 18:26:08 -0400
changeset 109584 9827af2a97cec5805dc0ed88ca34d1a71b8a092a
parent 109583 bf0aa600323fb6a0e6bbfb2d04c41eec930b597d
child 109585 3cf86586da0d439307495f42b14a7449fec19539
push id23636
push usergsharp@mozilla.com
push dateMon, 08 Oct 2012 08:08:19 +0000
treeherdermozilla-central@24cf40690042 [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
content/media/nsDOMMediaStream.cpp
gfx/thebes/gfxFT2FontList.cpp
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
media/webrtc/signaling/test/FakeMediaStreams.h
media/webrtc/signaling/test/FakeMediaStreamsImpl.h
media/webrtc/signaling/test/mediaconduit_unittests.cpp
media/webrtc/signaling/test/mediapipeline_unittest.cpp
media/webrtc/signaling/test/signaling_unittests.cpp
--- a/content/media/nsDOMMediaStream.cpp
+++ b/content/media/nsDOMMediaStream.cpp
@@ -38,17 +38,17 @@ nsDOMMediaStream::~nsDOMMediaStream()
 NS_IMETHODIMP
 nsDOMMediaStream::GetCurrentTime(double *aCurrentTime)
 {
   *aCurrentTime = mStream ? MediaTimeToSeconds(mStream->GetCurrentTime()) : 0.0;
   return NS_OK;
 }
 
 already_AddRefed<nsDOMMediaStream>
-nsDOMMediaStream::CreateInputStream(PRUint32 aHintContents)
+nsDOMMediaStream::CreateInputStream(uint32_t aHintContents)
 {
   nsRefPtr<nsDOMMediaStream> stream = new nsDOMMediaStream();
   stream->SetHintContents(aHintContents);
   MediaStreamGraph* gm = MediaStreamGraph::GetInstance();
   stream->mStream = gm->CreateInputStream(stream);
   return stream.forget();
 }
 
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -870,18 +870,18 @@ CopyFromUriToFile(nsCString aSpec, nsIFi
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIOutputStream> outputStream;
     rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream), aLocalFile);
     NS_ENSURE_SUCCESS(rv, rv);
 
     char buf[JAR_READ_BUFFER_SIZE];
     while (true) {
-        PRUint32 read;
-        PRUint32 written;
+        uint32_t read;
+        uint32_t written;
 
         rv = inputStream->Read(buf, JAR_READ_BUFFER_SIZE, &read);
         NS_ENSURE_SUCCESS(rv, rv);
 
         rv = outputStream->Write(buf, read, &written);
         NS_ENSURE_SUCCESS(rv, rv);
 
         if (written != read) {
@@ -942,17 +942,17 @@ void ExtractFontsFromJar(nsIFile* aLocal
 
             nsCString path(tmpPath, len);
             nsCOMPtr<nsIFile> localFile (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
             if (NS_FAILED(localFile->InitWithFile(aLocalDir))) {
                 allFontsExtracted = false;
                 continue;
             }
 
-            PRInt32 lastSlash = path.RFindChar('/');
+            int32_t lastSlash = path.RFindChar('/');
             nsCString fileName;
             if (lastSlash == kNotFound) {
                 fileName = path;
             } else {
                 fileName = Substring(path, lastSlash + 1);
             }
             if (NS_FAILED(localFile->AppendNative(fileName))) {
                 allFontsExtracted = false;
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -864,17 +864,17 @@ short vcmSetIceMediaParams(const char *p
  *
  *  Returns: zero(0) for success; otherwise, ERROR for failure
  */
 short vcmCreateRemoteStream(
   cc_mcapid_t mcap_id,
   const char *peerconnection,
   int *pc_stream_id,
   vcm_media_payload_type_t payload) {
-  PRUint32 hints = 0;
+  uint32_t hints = 0;
   nsresult res;
 
   CSFLogDebug( logTag, "%s", __FUNCTION__);
 
   mozilla::ScopedDeletePtr<sipcc::PeerConnectionWrapper> pc(
       sipcc::PeerConnectionImpl::AcquireInstance(peerconnection));
   MOZ_ASSERT(pc);
   if (!pc) {
@@ -2471,17 +2471,17 @@ vcmCreateTransportFlow(sipcc::PeerConnec
       return NULL;
     }
     res = dtls->SetVerificationDigest(fingerprint_alg, remote_digest, digest_len);
     if (!NS_SUCCEEDED(res)) {
       CSFLogError(logTag, "Could not set remote DTLS digest");
       return NULL;
     }
 
-    std::vector<PRUint16> srtp_ciphers;
+    std::vector<uint16_t> srtp_ciphers;
     srtp_ciphers.push_back(SRTP_AES128_CM_HMAC_SHA1_80);
     srtp_ciphers.push_back(SRTP_AES128_CM_HMAC_SHA1_32);
 
     res = dtls->SetSrtpCiphers(srtp_ciphers);
     if (!NS_SUCCEEDED(res)) {
       CSFLogError(logTag, "Couldn't set SRTP ciphers");
       return NULL;
     }
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -104,17 +104,17 @@ nsresult MediaPipeline::TransportReady(T
 
   MOZ_MTLOG(PR_LOG_DEBUG, "Transport ready for flow " << (rtcp ? "rtcp" : "rtp"));
 
   // Now instantiate the SRTP objects
   TransportLayerDtls *dtls = static_cast<TransportLayerDtls *>(
       flow->GetLayer(TransportLayerDtls::ID()));
   MOZ_ASSERT(dtls);  // DTLS is mandatory
 
-  PRUint16 cipher_suite;
+  uint16_t cipher_suite;
   res = dtls->GetSrtpCipher(&cipher_suite);
   if (NS_FAILED(res)) {
     MOZ_MTLOG(PR_LOG_ERROR, "Failed to negotiate DTLS-SRTP. This is an error");
     return res;
   }
 
   // SRTP Key Exporter as per RFC 5764 S 4.2
   unsigned char srtp_block[SRTP_TOTAL_KEY_LENGTH * 2];
@@ -486,17 +486,17 @@ nsresult MediaPipeline::PipelineTranspor
   return pipeline_->SendPacket(pipeline_->rtcp_transport_, inner_data,
                                out_len);
 }
 
 void MediaPipelineTransmit::PipelineListener::
 NotifyQueuedTrackChanges(MediaStreamGraph* graph, TrackID tid,
                          TrackRate rate,
                          TrackTicks offset,
-                         PRUint32 events,
+                         uint32_t events,
                          const MediaSegment& queued_media) {
   if (!pipeline_)
     return;  // Detached
 
   MOZ_MTLOG(PR_LOG_DEBUG, "MediaPipeline::NotifyQueuedTrackChanges()");
 
   // Return early if we are not connected to avoid queueing stuff
   // up in the conduit
@@ -558,34 +558,34 @@ void MediaPipelineTransmit::ProcessAudio
         MOZ_ASSERT(PR_FALSE);
         return;
         break;
       case nsAudioStream::FORMAT_S16:
         {
           // Code based on nsAudioStream
           const short* buf = static_cast<const short *>(chunk.mBuffer->Data());
 
-          PRInt32 volume = PRInt32((1 << 16) * chunk.mVolume);
-          for (PRUint32 i = 0; i < chunk.mDuration; ++i) {
+          int32_t volume = int32_t((1 << 16) * chunk.mVolume);
+          for (uint32_t i = 0; i < chunk.mDuration; ++i) {
             int16_t s = buf[i];
 #if defined(IS_BIG_ENDIAN)
             s = ((s & 0x00ff) << 8) | ((s & 0xff00) >> 8);
 #endif
-            samples[i] = short((PRInt32(s) * volume) >> 16);
+            samples[i] = short((int32_t(s) * volume) >> 16);
           }
         }
         break;
       default:
         MOZ_ASSERT(PR_FALSE);
         return;
         break;
     }
   } else {
     // This means silence.
-    for (PRUint32 i = 0; i < chunk.mDuration; ++i) {
+    for (uint32_t i = 0; i < chunk.mDuration; ++i) {
       samples[i] = 0;
     }
   }
 
   MOZ_MTLOG(PR_LOG_DEBUG, "Sending an audio frame");
   conduit->SendAudioFrame(samples.get(), chunk.mDuration, rate, 0);
 }
 
@@ -746,19 +746,19 @@ void MediaPipelineReceiveVideo::Pipeline
   SourceMediaStream *source =
       pipeline_->stream_->GetStream()->AsSourceStream();
 
   // Create a video frame and append it to the track.
   ImageFormat format = PLANAR_YCBCR;
   nsRefPtr<layers::Image> image = image_container_->CreateImage(&format, 1);
 
   layers::PlanarYCbCrImage* videoImage = static_cast<layers::PlanarYCbCrImage*>(image.get());
-  PRUint8* frame = const_cast<PRUint8*>(static_cast<const PRUint8*> (buffer));
-  const PRUint8 lumaBpp = 8;
-  const PRUint8 chromaBpp = 4;
+  uint8_t* frame = const_cast<uint8_t*>(static_cast<const uint8_t*> (buffer));
+  const uint8_t lumaBpp = 8;
+  const uint8_t chromaBpp = 4;
 
   layers::PlanarYCbCrImage::Data data;
   data.mYChannel = frame;
   data.mYSize = gfxIntSize(width_, height_);
   data.mYStride = width_ * lumaBpp/ 8;
   data.mCbCrStride = width_ * chromaBpp / 8;
   data.mCbChannel = frame + height_ * data.mYStride;
   data.mCrChannel = data.mCbChannel + height_ * data.mCbCrStride / 2;
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
@@ -198,17 +198,17 @@ class MediaPipelineTransmit : public Med
     pipeline_(pipeline) {}
     void Detach() { pipeline_ = NULL; }
 
 
     // Implement MediaStreamListener
     virtual void NotifyQueuedTrackChanges(MediaStreamGraph* graph, TrackID tid,
                                           TrackRate rate,
                                           TrackTicks offset,
-                                          PRUint32 events,
+                                          uint32_t events,
                                           const MediaSegment& queued_media);
     virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime) {}
 
    private:
     MediaPipelineTransmit *pipeline_;  // Raw pointer to avoid cycles
   };
   friend class PipelineListener;
 
@@ -287,17 +287,17 @@ class MediaPipelineReceiveAudio : public
         : pipeline_(pipeline),
         played_(0) {}
     void Detach() { pipeline_ = NULL; }
 
     // Implement MediaStreamListener
     virtual void NotifyQueuedTrackChanges(MediaStreamGraph* graph, TrackID tid,
                                           TrackRate rate,
                                           TrackTicks offset,
-                                          PRUint32 events,
+                                          uint32_t events,
                                           const MediaSegment& queued_media) {}
     virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime);
 
    private:
     MediaPipelineReceiveAudio *pipeline_;  // Raw pointer to avoid cycles
     StreamTime played_;
   };
   friend class PipelineListener;
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -92,17 +92,17 @@ public:
           StatusCode code;
           std::string s_sdpstr;
           MediaStreamTable *streams = NULL;
 
           cc_call_state_t state = mInfo->getCallState();
           std::string statestr = mInfo->callStateToString(state);
 
           nsDOMMediaStream* stream;
-          PRUint32 hint;
+          uint32_t hint;
 
           switch (state) {
             case CREATEOFFER:
               s_sdpstr = mInfo->getSDP();
               mObserver->OnCreateOfferSuccess(s_sdpstr.c_str());
               break;
 
             case CREATEANSWER:
@@ -210,17 +210,17 @@ private:
  * we add this class as a listener.
  */
 void
 LocalSourceStreamInfo::NotifyQueuedTrackChanges(
   mozilla::MediaStreamGraph* aGraph,
   mozilla::TrackID aID,
   mozilla::TrackRate aTrackRate,
   mozilla::TrackTicks aTrackOffset,
-  PRUint32 aTrackEvents,
+  uint32_t aTrackEvents,
   const mozilla::MediaSegment& aQueuedMedia)
 {
   /* TODO: use this callback to keep track of changes to the MediaStream */
 }
 
 /* If the ExpectAudio hint is on we will add a track at the default first
  * audio track ID (0)
  * FIX - Do we need to iterate over the tracks instead of taking these hints?
@@ -289,17 +289,17 @@ PeerConnectionImpl::~PeerConnectionImpl(
   nsCOMPtr<nsIThread> mainThread;
   NS_GetMainThread(getter_AddRefs(mainThread));
   NS_ProxyRelease(mainThread, mPCObserver);
   */
 }
 
 // One level of indirection so we can use WrapRunnable in CreateMediaStream.
 nsresult
-PeerConnectionImpl::MakeMediaStream(PRUint32 aHint, nsIDOMMediaStream** aRetval)
+PeerConnectionImpl::MakeMediaStream(uint32_t aHint, nsIDOMMediaStream** aRetval)
 {
   MOZ_ASSERT(aRetval);
 
   nsRefPtr<nsDOMMediaStream> stream = nsDOMMediaStream::CreateInputStream(aHint);
   NS_ADDREF(*aRetval = stream);
 
   CSFLogDebugS(logTag, "PeerConnection " << static_cast<void*>(this)
     << ": Created media stream " << static_cast<void*>(stream)
@@ -316,17 +316,17 @@ PeerConnectionImpl::MakeRemoteSource(nsD
 
   // TODO(ekr@rtfm.com): Add the track info with the first segment
   nsRefPtr<RemoteSourceStreamInfo> remote = new RemoteSourceStreamInfo(aStream);
   NS_ADDREF(*aInfo = remote);
   return NS_OK;
 }
 
 nsresult
-PeerConnectionImpl::CreateRemoteSourceStreamInfo(PRUint32 aHint, RemoteSourceStreamInfo** aInfo)
+PeerConnectionImpl::CreateRemoteSourceStreamInfo(uint32_t aHint, RemoteSourceStreamInfo** aInfo)
 {
   MOZ_ASSERT(aInfo);
 
   nsIDOMMediaStream* stream;
 
   nsresult res;
   if (!mThread || NS_IsMainThread()) {
     res = MakeMediaStream(aHint, &stream);
@@ -504,17 +504,17 @@ PeerConnectionImpl::Initialize(IPeerConn
     PR_Sleep(100);
   }
 #endif
 
   return NS_OK;
 }
 
 nsresult
-PeerConnectionImpl::CreateFakeMediaStream(PRUint32 aHint, nsIDOMMediaStream** aRetval)
+PeerConnectionImpl::CreateFakeMediaStream(uint32_t aHint, nsIDOMMediaStream** aRetval)
 {
   MOZ_ASSERT(aRetval);
 
   bool mute = false;
 
   // Hack to allow you to mute the stream
   if (aHint & MEDIA_STREAM_MUTE) {
     mute = true;
@@ -546,19 +546,19 @@ PeerConnectionImpl::CreateFakeMediaStrea
 
   return NS_OK;
 }
 
 // Data channels won't work without a window, so in order for the C++ unit
 // tests to work (it doesn't have a window available) we ifdef the following
 // two implementations.
 NS_IMETHODIMP
-PeerConnectionImpl::ConnectDataConnection(PRUint16 aLocalport,
-                                          PRUint16 aRemoteport,
-                                          PRUint16 aNumstreams)
+PeerConnectionImpl::ConnectDataConnection(uint16_t aLocalport,
+                                          uint16_t aRemoteport,
+                                          uint16_t aNumstreams)
 {
 #ifdef MOZILLA_INTERNAL_API
   mDataConnection = new mozilla::DataChannelConnection(this);
   NS_ENSURE_TRUE(mDataConnection,NS_ERROR_FAILURE);
   if (!mDataConnection->Init(aLocalport, aNumstreams, true)) {
     CSFLogError(logTag,"%s DataConnection Init Failed",__FUNCTION__);
     return NS_ERROR_FAILURE;
   }
@@ -571,20 +571,20 @@ PeerConnectionImpl::ConnectDataConnectio
   return NS_OK;
 #else
     return NS_ERROR_FAILURE;
 #endif
 }
 
 NS_IMETHODIMP
 PeerConnectionImpl::CreateDataChannel(const nsACString& aLabel,
-                                      PRUint16 aType,
+                                      uint16_t aType,
                                       bool outOfOrderAllowed,
-                                      PRUint16 aMaxTime,
-                                      PRUint16 aMaxNum,
+                                      uint16_t aMaxTime,
+                                      uint16_t aMaxNum,
                                       nsIDOMDataChannel** aRetval)
 {
   MOZ_ASSERT(aRetval);
 
 #ifdef MOZILLA_INTERNAL_API
   mozilla::DataChannel* dataChannel;
   mozilla::DataChannelConnection::Type theType =
     static_cast<mozilla::DataChannelConnection::Type>(aType);
@@ -696,27 +696,27 @@ PeerConnectionImpl::CreateAnswer(const c
 
   CheckIceState();
   mRole = kRoleAnswerer;  // TODO(ekr@rtfm.com): Interrogate SIPCC here?
   mCall->createAnswer(aHints, aOffer);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-PeerConnectionImpl::SetLocalDescription(PRInt32 aAction, const char* aSDP) {
+PeerConnectionImpl::SetLocalDescription(int32_t aAction, const char* aSDP) {
   MOZ_ASSERT(aSDP);
 
   CheckIceState();
   mLocalRequestedSDP = aSDP;
   mCall->setLocalDescription((cc_jsep_action_t)aAction, mLocalRequestedSDP);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-PeerConnectionImpl::SetRemoteDescription(PRInt32 action, const char* aSDP) {
+PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP) {
   MOZ_ASSERT(aSDP);
 
   CheckIceState();
   mRemoteRequestedSDP = aSDP;
   mCall->setRemoteDescription((cc_jsep_action_t)action, mRemoteRequestedSDP);
   return NS_OK;
 }
 
@@ -726,17 +726,17 @@ PeerConnectionImpl::AddStream(nsIDOMMedi
   MOZ_ASSERT(aMediaStream);
 
   nsDOMMediaStream* stream = static_cast<nsDOMMediaStream*>(aMediaStream);
 
   CSFLogDebugS(logTag, __FUNCTION__ << ": MediaStream: " << static_cast<void*>(aMediaStream));
 
   // TODO(ekr@rtfm.com): Remove these asserts?
   // Adding tracks here based on nsDOMMediaStream expectation settings
-  PRUint32 hints = stream->GetHintContents();
+  uint32_t hints = stream->GetHintContents();
 
   if (!(hints & (nsDOMMediaStream::HINT_CONTENTS_AUDIO |
         nsDOMMediaStream::HINT_CONTENTS_VIDEO))) {
     CSFLogDebug(logTag, "Empty Stream !!");
     return NS_OK;
   }
 
   // Now see if we already have a stream of this type, since we only
@@ -791,17 +791,17 @@ PeerConnectionImpl::RemoveStream(nsIDOMM
   nsDOMMediaStream* stream = static_cast<nsDOMMediaStream*>(aMediaStream);
 
   CSFLogDebugS(logTag, __FUNCTION__ << ": MediaStream: " << static_cast<void*>(aMediaStream));
 
   PR_Lock(mLocalSourceStreamsLock);
   for (uint32_t u = 0; u < mLocalSourceStreams.Length(); u++) {
     nsRefPtr<LocalSourceStreamInfo> localSourceStream = mLocalSourceStreams[u];
     if (localSourceStream->GetMediaStream() == stream) {
-      PRUint32 hints = stream->GetHintContents();
+      uint32_t hints = stream->GetHintContents();
       if (hints & nsDOMMediaStream::HINT_CONTENTS_AUDIO) {
         // <emannion>  This API will change when we implement multiple streams
         //             It will only need the ID
         mCall->removeStream(u, 0, AUDIO);
       }
       if (hints & nsDOMMediaStream::HINT_CONTENTS_VIDEO) {
         mCall->removeStream(u, 1, VIDEO);
       }
@@ -887,36 +887,36 @@ PeerConnectionImpl::GetRemoteDescription
   std::copy(mRemoteSDP.begin(), mRemoteSDP.end(), tmp);
   tmp[mRemoteSDP.size()] = '\0';
 
   *aSDP = tmp;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-PeerConnectionImpl::GetReadyState(PRUint32* aState)
+PeerConnectionImpl::GetReadyState(uint32_t* aState)
 {
   MOZ_ASSERT(aState);
 
   *aState = mReadyState;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-PeerConnectionImpl::GetSipccState(PRUint32* aState)
+PeerConnectionImpl::GetSipccState(uint32_t* aState)
 {
   MOZ_ASSERT(aState);
 
   PeerConnectionCtx* pcctx = PeerConnectionCtx::GetInstance();
   *aState = pcctx ? pcctx->sipcc_state() : kIdle;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-PeerConnectionImpl::GetIceState(PRUint32* aState)
+PeerConnectionImpl::GetIceState(uint32_t* aState)
 {
   MOZ_ASSERT(aState);
 
   *aState = mIceState;
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -951,21 +951,21 @@ PeerConnectionImpl::Close()
 
   CSFLogDebugS(logTag, __FUNCTION__ << " Media shut down");
 }
 
 void
 PeerConnectionImpl::DisconnectMediaStreams()
 {
   // TODO(ekr@rtfm.com): Lock
-  for (PRUint32 i=0; i < mLocalSourceStreams.Length(); ++i) {
+  for (uint32_t i=0; i < mLocalSourceStreams.Length(); ++i) {
     mLocalSourceStreams[i]->Detach();
   }
 
-  for (PRUint32 i=0; i < mRemoteSourceStreams.Length(); ++i) {
+  for (uint32_t i=0; i < mRemoteSourceStreams.Length(); ++i) {
     mRemoteSourceStreams[i]->Detach();
   }
 
   mLocalSourceStreams.Clear();
   mRemoteSourceStreams.Clear();
 }
 
 void
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -107,41 +107,41 @@ class Fake_VideoGenerator {
 
     // Set the timer. Set to 10 fps.
     mTimer->InitWithFuncCallback(Callback, this, 100, nsITimer::TYPE_REPEATING_SLACK);
   }
 
   static void Callback(nsITimer* timer, void *arg) {
     Fake_VideoGenerator* gen = static_cast<Fake_VideoGenerator*>(arg);
 
-    const PRUint32 WIDTH = 640;
-    const PRUint32 HEIGHT = 480;
+    const uint32_t WIDTH = 640;
+    const uint32_t HEIGHT = 480;
 
     // Allocate a single blank Image
     mozilla::ImageFormat format = mozilla::PLANAR_YCBCR;
     nsRefPtr<mozilla::layers::ImageContainer> container =
       mozilla::layers::LayerManager::CreateImageContainer();
 
     nsRefPtr<mozilla::layers::Image> image = container->CreateImage(&format, 1);
 
     int len = ((WIDTH * HEIGHT) * 3 / 2);
     mozilla::layers::PlanarYCbCrImage* planar =
       static_cast<mozilla::layers::PlanarYCbCrImage*>(image.get());
-    PRUint8* frame = (PRUint8*) PR_Malloc(len);
+    uint8_t* frame = (uint8_t*) PR_Malloc(len);
     ++gen->mCount;
     memset(frame, (gen->mCount / 8) & 0xff, len); // Rotating colors
 
-    const PRUint8 lumaBpp = 8;
-    const PRUint8 chromaBpp = 4;
+    const uint8_t lumaBpp = 8;
+    const uint8_t chromaBpp = 4;
 
     mozilla::layers::PlanarYCbCrImage::Data data;
     data.mYChannel = frame;
     data.mYSize = gfxIntSize(WIDTH, HEIGHT);
-    data.mYStride = (PRInt32) (WIDTH * lumaBpp / 8.0);
-    data.mCbCrStride = (PRInt32) (WIDTH * chromaBpp / 8.0);
+    data.mYStride = (int32_t) (WIDTH * lumaBpp / 8.0);
+    data.mCbCrStride = (int32_t) (WIDTH * chromaBpp / 8.0);
     data.mCbChannel = frame + HEIGHT * data.mYStride;
     data.mCrChannel = data.mCbChannel + HEIGHT * data.mCbCrStride / 2;
     data.mCbCrSize = gfxIntSize(WIDTH / 2, HEIGHT / 2);
     data.mPicX = 0;
     data.mPicY = 0;
     data.mPicSize = gfxIntSize(WIDTH, HEIGHT);
     data.mStereoMode = mozilla::STEREO_MODE_MONO;
 
@@ -178,17 +178,17 @@ public:
    * TRACK_EVENT_ENDED. aQueuedMedia is the data being added to the track
    * at aTrackOffset (relative to the start of the stream).
    */
   virtual void NotifyQueuedTrackChanges(
     mozilla::MediaStreamGraph* aGraph,
     mozilla::TrackID aID,
     mozilla::TrackRate aTrackRate,
     mozilla::TrackTicks aTrackOffset,
-    PRUint32 aTrackEvents,
+    uint32_t aTrackEvents,
     const mozilla::MediaSegment& aQueuedMedia
   );
 
   virtual void NotifyPull(mozilla::MediaStreamGraph* aGraph,
     mozilla::StreamTime aDesiredTime) {}
 
   nsDOMMediaStream* GetMediaStream() {
     return mMediaStream;
@@ -289,17 +289,17 @@ public:
 
   NS_DECL_ISUPPORTS
   NS_DECL_IPEERCONNECTION
 
   static PeerConnectionImpl* CreatePeerConnection();
   static void Shutdown();
 
   Role GetRole() const { return mRole; }
-  nsresult CreateRemoteSourceStreamInfo(PRUint32 aHint, RemoteSourceStreamInfo** aInfo);
+  nsresult CreateRemoteSourceStreamInfo(uint32_t aHint, RemoteSourceStreamInfo** aInfo);
 
   // Implementation of the only observer we need
   virtual void onCallEvent(
     ccapi_call_event_e aCallEvent,
     CSF::CC_CallPtr aCall,
     CSF::CC_CallInfoPtr aInfo
   );
 
@@ -363,17 +363,17 @@ public:
 
   // Get the STS thread
   nsCOMPtr<nsIEventTarget> GetSTSThread() { return mSTSThread; }
 
   // Get the DTLS identity
   mozilla::RefPtr<DtlsIdentity> const GetIdentity() { return mIdentity; }
 
   // Create a fake media stream
-  nsresult CreateFakeMediaStream(PRUint32 hint, nsIDOMMediaStream** retval);
+  nsresult CreateFakeMediaStream(uint32_t hint, nsIDOMMediaStream** retval);
 
 private:
   PeerConnectionImpl(const PeerConnectionImpl&rhs);
   PeerConnectionImpl& operator=(PeerConnectionImpl);
 
   void ChangeReadyState(ReadyState aReadyState);
   void CheckIceState() {
     PR_ASSERT(mIceState != kIceGathering);
@@ -384,17 +384,17 @@ private:
 
   // Disconnect the media streams. Must be called on the
   // main thread.
   void DisconnectMediaStreams();
 
   // Shutdown media transport. Must be called on STS thread.
   void ShutdownMediaTransport();
 
-  nsresult MakeMediaStream(PRUint32 aHint, nsIDOMMediaStream** aStream);
+  nsresult MakeMediaStream(uint32_t aHint, nsIDOMMediaStream** aStream);
   nsresult MakeRemoteSource(nsDOMMediaStream* aStream, RemoteSourceStreamInfo** aInfo);
 
   // The role we are adopting
   Role mRole;
 
   // The call
   CSF::CC_CallPtr mCall;
   ReadyState mReadyState;
--- a/media/webrtc/signaling/test/FakeMediaStreams.h
+++ b/media/webrtc/signaling/test/FakeMediaStreams.h
@@ -34,17 +34,17 @@ class Fake_SourceMediaStream;
 class Fake_MediaStreamListener
 {
 public:
   virtual ~Fake_MediaStreamListener() {}
 
   virtual void NotifyQueuedTrackChanges(mozilla::MediaStreamGraph* aGraph, mozilla::TrackID aID,
                                         mozilla::TrackRate aTrackRate,
                                         mozilla::TrackTicks aTrackOffset,
-                                        PRUint32 aTrackEvents,
+                                        uint32_t aTrackEvents,
                                         const mozilla::MediaSegment& aQueuedMedia)  = 0;
   virtual void NotifyPull(mozilla::MediaStreamGraph* aGraph, mozilla::StreamTime aDesiredTime) = 0;
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Fake_MediaStreamListener)
 };
 
 
 // Note: only one listener supported
@@ -141,17 +141,17 @@ public:
     // Note: memory leak
     mMediaStream->Stop();
   }
 
   
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMMEDIASTREAM
     
-  static already_AddRefed<Fake_nsDOMMediaStream> CreateInputStream(PRUint32 aHintContents) {
+  static already_AddRefed<Fake_nsDOMMediaStream> CreateInputStream(uint32_t aHintContents) {
     Fake_SourceMediaStream *source = new Fake_SourceMediaStream();
     
     Fake_nsDOMMediaStream *ds = new Fake_nsDOMMediaStream(source);
     ds->SetHintContents(aHintContents);
     ds->AddRef();
     
     return ds;
   }
@@ -159,25 +159,25 @@ public:
   Fake_MediaStream *GetStream() { return mMediaStream; }
 
   // Hints to tell the SDP generator about whether this
   // MediaStream probably has audio and/or video
   enum {
     HINT_CONTENTS_AUDIO = 0x00000001U,
     HINT_CONTENTS_VIDEO = 0x00000002U
   };
-  PRUint32 GetHintContents() const { return mHintContents; }
-  void SetHintContents(PRUint32 aHintContents) { mHintContents = aHintContents; }
+  uint32_t GetHintContents() const { return mHintContents; }
+  void SetHintContents(uint32_t aHintContents) { mHintContents = aHintContents; }
 
 private:
   Fake_MediaStream *mMediaStream;
 
   // tells the SDP generator about whether this
   // MediaStream probably has audio and/or video
-  PRUint32 mHintContents;
+  uint32_t mHintContents;
 };
 
 class Fake_MediaStreamGraph
 {
 public:
   virtual ~Fake_MediaStreamGraph() {}
 };
 
--- a/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
+++ b/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
@@ -135,21 +135,21 @@ NS_IMETHODIMP
 Fake_VideoStreamSource::Notify(nsITimer* aTimer)
 {
 #if 0
   mozilla::layers::BufferRecycleBin bin;
 
   nsRefPtr<mozilla::layers::PlanarYCbCrImage> image = new
     mozilla::layers::PlanarYCbCrImage(&bin);
 
-  const PRUint8 lumaBpp = 8;
-  const PRUint8 chromaBpp = 4;
+  const uint8_t lumaBpp = 8;
+  const uint8_t chromaBpp = 4;
 
   int len = ((WIDTH * HEIGHT) * 3 / 2);
-  PRUint8* frame = (PRUint8*) PR_Malloc(len);
+  uint8_t* frame = (uint8_t*) PR_Malloc(len);
   memset(frame, 0x80, len); // Gray
 
   mozilla::layers::PlanarYCbCrImage::Data data;
   data.mYChannel = frame;
   data.mYSize = gfxIntSize(WIDTH, HEIGHT);
   data.mYStride = WIDTH * lumaBpp / 8.0;
   data.mCbCrStride = WIDTH * chromaBpp / 8.0;
   data.mCbChannel = frame + HEIGHT * data.mYStride;
@@ -171,22 +171,22 @@ Fake_VideoStreamSource::Notify(nsITimer*
 
 
 #if 0
 // Fake up buffer recycle bin
 mozilla::layers::BufferRecycleBin::BufferRecycleBin() : 
  mLock("mozilla.layers.BufferRecycleBin.mLock") {
 }
 
-void mozilla::layers::BufferRecycleBin::RecycleBuffer(PRUint8* buffer, PRUint32 size) {
+void mozilla::layers::BufferRecycleBin::RecycleBuffer(uint8_t* buffer, uint32_t size) {
   PR_Free(buffer);
 }
 
-PRUint8 *mozilla::layers::BufferRecycleBin::GetBuffer(PRUint32 size) {
-  return (PRUint8 *)PR_MALLOC(size);
+uint8_t *mozilla::layers::BufferRecycleBin::GetBuffer(uint32_t size) {
+  return (uint8_t *)PR_MALLOC(size);
 }
 
 // YCbCrImage constructor (from ImageLayers.cpp)
 mozilla::layers::PlanarYCbCrImage::PlanarYCbCrImage(BufferRecycleBin *aRecycleBin)
   : Image(nsnull, PLANAR_YCBCR)
   , mBufferSize(0)
   , mRecycleBin(aRecycleBin)
 {
--- a/media/webrtc/signaling/test/mediaconduit_unittests.cpp
+++ b/media/webrtc/signaling/test/mediaconduit_unittests.cpp
@@ -69,17 +69,17 @@ public:
   void Init(mozilla::RefPtr<mozilla::VideoSessionConduit> aSession)
   {
         mSession = aSession;
   }
   void GenerateAndReadSamples()
   {
 
     int len = ((width * height) * 3 / 2);
-    PRUint8* frame = (PRUint8*) PR_MALLOC(len);
+    uint8_t* frame = (uint8_t*) PR_MALLOC(len);
     int numFrames = 121;
     memset(frame, COLOR, len);
 
     do
     {
       mSession->SendVideoFrame((unsigned char*)frame,
                                 len,
                                 width,
--- a/media/webrtc/signaling/test/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
@@ -65,17 +65,17 @@ class TestAgent {
     ASSERT_EQ((nsresult)NS_OK, res);
 
     test_utils.sts_target()->Dispatch(WrapRunnable(audio_prsock_, &TransportLayerPrsock::Import,
                                    fd, &res), NS_DISPATCH_SYNC);
     ASSERT_TRUE(NS_SUCCEEDED(res));
 
     ASSERT_EQ((nsresult)NS_OK, audio_flow_->PushLayer(audio_prsock_));
 
-    std::vector<PRUint16> ciphers;
+    std::vector<uint16_t> ciphers;
     ciphers.push_back(SRTP_AES128_CM_HMAC_SHA1_80);
     audio_dtls_->SetSrtpCiphers(ciphers);
     audio_dtls_->SetIdentity(DtlsIdentity::Generate());
     audio_dtls_->SetRole(client ? TransportLayerDtls::CLIENT :
                          TransportLayerDtls::SERVER);
     audio_flow_->PushLayer(audio_dtls_);
   }
 
--- a/media/webrtc/signaling/test/signaling_unittests.cpp
+++ b/media/webrtc/signaling/test/signaling_unittests.cpp
@@ -100,18 +100,18 @@ public:
 
   std::vector<nsDOMMediaStream *> GetStreams() { return streams; }
 
   NS_DECL_ISUPPORTS
   NS_DECL_IPEERCONNECTIONOBSERVER
 
   ResponseState state;
   char *lastString;
-  PRUint32 lastStatusCode;
-  PRUint32 lastStateType;
+  uint32_t lastStatusCode;
+  uint32_t lastStateType;
   bool onAddStreamCalled;
 
 private:
   sipcc::PeerConnectionImpl *pc;
   std::vector<nsDOMMediaStream *> streams;
 };
 
 NS_IMPL_THREADSAFE_ISUPPORTS1(TestObserver, IPeerConnectionObserver)
@@ -121,17 +121,17 @@ TestObserver::OnCreateOfferSuccess(const
 {
   state = stateSuccess;
   cout << "onCreateOfferSuccess = " << offer << endl;
   lastString = strdup(offer);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TestObserver::OnCreateOfferError(PRUint32 code)
+TestObserver::OnCreateOfferError(uint32_t code)
 {
   state = stateError;
   cout << "onCreateOfferError" << endl;
   lastStatusCode = code;
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -139,49 +139,49 @@ TestObserver::OnCreateAnswerSuccess(cons
 {
   state = stateSuccess;
   cout << "onCreateAnswerSuccess = " << answer << endl;
   lastString = strdup(answer);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TestObserver::OnCreateAnswerError(PRUint32 code)
+TestObserver::OnCreateAnswerError(uint32_t code)
 {
   state = stateError;
   lastStatusCode = code;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TestObserver::OnSetLocalDescriptionSuccess(PRUint32 code)
+TestObserver::OnSetLocalDescriptionSuccess(uint32_t code)
 {
   state = stateSuccess;
   lastStatusCode = code;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TestObserver::OnSetRemoteDescriptionSuccess(PRUint32 code)
+TestObserver::OnSetRemoteDescriptionSuccess(uint32_t code)
 {
   state = stateSuccess;
   lastStatusCode = code;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TestObserver::OnSetLocalDescriptionError(PRUint32 code)
+TestObserver::OnSetLocalDescriptionError(uint32_t code)
 {
   state = stateError;
   lastStatusCode = code;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TestObserver::OnSetRemoteDescriptionError(PRUint32 code)
+TestObserver::OnSetRemoteDescriptionError(uint32_t code)
 {
   state = stateError;
   lastStatusCode = code;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TestObserver::NotifyConnection()
@@ -197,20 +197,20 @@ TestObserver::NotifyClosedConnection()
 
 NS_IMETHODIMP
 TestObserver::NotifyDataChannel(nsIDOMDataChannel *channel)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TestObserver::OnStateChange(PRUint32 state_type)
+TestObserver::OnStateChange(uint32_t state_type)
 {
   nsresult rv;
-  PRUint32 gotstate;
+  uint32_t gotstate;
 
   switch (state_type)
   {
   case kReadyState:
     rv = pc->GetReadyState(&gotstate);
     NS_ENSURE_SUCCESS(rv, rv);
     cout << "Ready State: " << gotstate << endl;
     break;
@@ -445,27 +445,27 @@ class SignalingAgent {
     ASSERT_EQ(pc->Initialize(pObserver, nullptr, nullptr), NS_OK);
 
     ASSERT_TRUE_WAIT(sipcc_state() == sipcc::PeerConnectionImpl::kStarted,
                      kDefaultTimeout);
     ASSERT_TRUE_WAIT(ice_state() == sipcc::PeerConnectionImpl::kIceWaiting, 5000);
     cout << "Init Complete" << endl;
   }
 
-  PRUint32 sipcc_state()
+  uint32_t sipcc_state()
   {
-    PRUint32 res;
+    uint32_t res;
 
     pc->GetSipccState(&res);
     return res;
   }
 
-  PRUint32 ice_state()
+  uint32_t ice_state()
   {
-    PRUint32 res;
+    uint32_t res;
 
     pc->GetIceState(&res);
     return res;
   }
 
   void Close()
   {
     cout << "Close" << endl;
@@ -490,17 +490,17 @@ class SignalingAgent {
         NS_DISPATCH_SYNC);
 
     ASSERT_TRUE(NS_SUCCEEDED(ret));
 
     // store in object to be used by RemoveStream
     nsRefPtr<nsDOMMediaStream> domMediaStream = new nsDOMMediaStream(audio_stream);
     domMediaStream_ = domMediaStream;
 
-    PRUint32 aHintContents = 0;
+    uint32_t aHintContents = 0;
 
     if (audio) {
       aHintContents |= nsDOMMediaStream::HINT_CONTENTS_AUDIO;
     }
     if (video) {
       aHintContents |= nsDOMMediaStream::HINT_CONTENTS_VIDEO;
     }
 
@@ -537,17 +537,17 @@ class SignalingAgent {
     ASSERT_EQ(pc->CreateAnswer(hints, offer.c_str()), NS_OK);
     ASSERT_TRUE_WAIT(pObserver->state == TestObserver::stateSuccess, kDefaultTimeout);
     SDPSanityCheck(pObserver->lastString, true, true, false);
     answer_ = pObserver->lastString;
   }
 
   void CreateOfferRemoveStream(const char* hints, bool audio, bool video) {
 
-    PRUint32 aHintContents = 0;
+    uint32_t aHintContents = 0;
 
     if (!audio) {
       aHintContents |= nsDOMMediaStream::HINT_CONTENTS_VIDEO;
     }
     if (!video) {
       aHintContents |= nsDOMMediaStream::HINT_CONTENTS_AUDIO;
     }
 
@@ -585,17 +585,17 @@ class SignalingAgent {
         
         ASSERT_TRUE(NS_SUCCEEDED(pc->AddIceCandidate((*it).second.c_str(), "", (*it).first)));
       }
     }
   }
   
 
   bool IceCompleted() {
-    PRUint32 state;
+    uint32_t state;
     pc->GetIceState(&state);
     return state == sipcc::PeerConnectionImpl::kIceConnected;
   }
 
   void AddIceCandidate(const char* candidate, const char* mid, unsigned short level) {
     pc->AddIceCandidate(candidate, mid, level);
   }