Bug 879477: Update PC to use mHandle instead of (void *) this in logging r=ekr
authorAdam Roach [:abr] <adam@nostrum.com>
Mon, 10 Jun 2013 15:47:25 -0700
changeset 134575 7ef0e47cddd4d3df5f86d1e4a8617d3eba7a1a9d
parent 134574 4b69dc0eb786deabc4dbe290e9e622bc108ee1e5
child 134576 773df082bd35fca7b8ca9f19920f2bd2880659e1
push id29279
push useradam@nostrum.com
push dateMon, 10 Jun 2013 22:47:32 +0000
treeherdermozilla-inbound@7ef0e47cddd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersekr
bugs879477
milestone24.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 879477: Update PC to use mHandle instead of (void *) this in logging r=ekr
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -330,32 +330,32 @@ PeerConnectionImpl::PeerConnectionImpl()
   , mSTSThread(NULL)
   , mMedia(NULL)
   , mNumAudioStreams(0)
   , mNumVideoStreams(0)
   , mHaveDataStream(false) {
 #ifdef MOZILLA_INTERNAL_API
   MOZ_ASSERT(NS_IsMainThread());
 #endif
-  CSFLogInfo(logTag, "%s: PeerConnectionImpl constructor for %p",
-             __FUNCTION__, (void *) this);
+  CSFLogInfo(logTag, "%s: PeerConnectionImpl constructor for %s",
+             __FUNCTION__, mHandle.c_str());
 }
 
 PeerConnectionImpl::~PeerConnectionImpl()
 {
   // This aborts if not on main thread (in Debug builds)
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
   if (PeerConnectionCtx::isActive()) {
     PeerConnectionCtx::GetInstance()->mPeerConnections.erase(mHandle);
   } else {
     CSFLogError(logTag, "PeerConnectionCtx is already gone. Ignoring...");
   }
 
-  CSFLogInfo(logTag, "%s: PeerConnectionImpl destructor invoked for %p",
-             __FUNCTION__, (void *) this);
+  CSFLogInfo(logTag, "%s: PeerConnectionImpl destructor invoked for %s",
+             __FUNCTION__, mHandle.c_str());
   CloseInt();
 
 #ifdef MOZILLA_INTERNAL_API
   // Deregister as an NSS Shutdown Object
   shutdown(calledFromObject);
 #endif
 
   // Since this and Initialize() occur on MainThread, they can't both be
@@ -726,18 +726,18 @@ PeerConnectionImpl::EnsureDataConnection
     // and we increase the number of streams dynamically as needed.
     return NS_OK;
   }
   mDataConnection = new mozilla::DataChannelConnection(this);
   if (!mDataConnection->Init(5000, aNumstreams, true)) {
     CSFLogError(logTag,"%s DataConnection Init Failed",__FUNCTION__);
     return NS_ERROR_FAILURE;
   }
-  CSFLogDebug(logTag,"%s DataChannelConnection %p attached to %p",
-              __FUNCTION__, (void*) mDataConnection.get(), (void *) this);
+  CSFLogDebug(logTag,"%s DataChannelConnection %p attached to %s",
+              __FUNCTION__, (void*) mDataConnection.get(), mHandle.c_str());
 #endif
   return NS_OK;
 }
 
 nsresult
 PeerConnectionImpl::InitializeDataChannel(int track_id,
                                           uint16_t aLocalport,
                                           uint16_t aRemoteport,
@@ -1282,37 +1282,37 @@ PeerConnectionImpl::CheckApiState(bool a
   if (!mMedia)
     return NS_ERROR_FAILURE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PeerConnectionImpl::Close()
 {
-  CSFLogDebug(logTag, "%s: for %p", __FUNCTION__, (void *) this);
+  CSFLogDebug(logTag, "%s: for %s", __FUNCTION__, mHandle.c_str());
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   return CloseInt();
 }
 
 
 nsresult
 PeerConnectionImpl::CloseInt()
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   if (mCall) {
-    CSFLogInfo(logTag, "%s: Closing PeerConnectionImpl %p; "
-               "ending call", __FUNCTION__, (void *) this);
+    CSFLogInfo(logTag, "%s: Closing PeerConnectionImpl %s; "
+               "ending call", __FUNCTION__, mHandle.c_str());
     mCall->endCall();
   }
 #ifdef MOZILLA_INTERNAL_API
   if (mDataConnection) {
-    CSFLogInfo(logTag, "%s: Destroying DataChannelConnection %p for %p",
-               __FUNCTION__, (void *) mDataConnection.get(), (void *) this);
+    CSFLogInfo(logTag, "%s: Destroying DataChannelConnection %p for %s",
+               __FUNCTION__, (void *) mDataConnection.get(), mHandle.c_str());
     mDataConnection->Destroy();
     mDataConnection = nullptr; // it may not go away until the runnables are dead
   }
 #endif
 
   ShutdownMedia();
 
   // DataConnection will need to stay alive until all threads/runnables exit