Bug 1353668. P3 - rename CMLOG to LOG. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 05 Apr 2017 17:38:20 +0800
changeset 556579 1b4638d5e3956da8c8b4eb2c2684226970aa8f0b
parent 556578 81f2e9b5c4add258a783a8c134c2cbf93ca6322b
child 622925 f3a6032724dcc3bf2b0e9486aa7081799294ef43
push id52586
push userjwwang@mozilla.com
push dateThu, 06 Apr 2017 03:05:37 +0000
bugs1353668
milestone55.0a1
Bug 1353668. P3 - rename CMLOG to LOG. MozReview-Commit-ID: 67dN3NEBCA7
dom/media/MediaResource.cpp
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -29,19 +29,21 @@
 #include "nsContentUtils.h"
 #include "nsHostObjectProtocolHandler.h"
 #include <algorithm>
 #include "nsProxyRelease.h"
 #include "nsIContentPolicy.h"
 
 using mozilla::media::TimeUnit;
 
+#undef LOG
+
 mozilla::LazyLogModule gMediaResourceLog("MediaResource");
 // Debug logging macro with object pointer and class name.
-#define CMLOG(msg, ...) MOZ_LOG(gMediaResourceLog, mozilla::LogLevel::Debug, \
+#define LOG(msg, ...) MOZ_LOG(gMediaResourceLog, mozilla::LogLevel::Debug, \
   ("%p " msg, this, ##__VA_ARGS__))
 
 static const uint32_t HTTP_OK_CODE = 200;
 static const uint32_t HTTP_PARTIAL_RESPONSE_CODE = 206;
 
 namespace mozilla {
 
 void
@@ -354,18 +356,18 @@ ChannelMediaResource::ParseContentRangeH
   if (aRangeTotalText[0] == '*') {
     aRangeTotal = -1;
   } else {
     aRangeTotal = aRangeTotalText.ToInteger64(&rv);
     NS_ENSURE_TRUE(aRangeEnd < aRangeTotal, NS_ERROR_ILLEGAL_VALUE);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  CMLOG("Received bytes [%" PRId64 "] to [%" PRId64 "] of [%" PRId64 "] for decoder[%p]",
-        aRangeStart, aRangeEnd, aRangeTotal, mCallback.get());
+  LOG("Received bytes [%" PRId64 "] to [%" PRId64 "] of [%" PRId64 "] for decoder[%p]",
+      aRangeStart, aRangeEnd, aRangeTotal, mCallback.get());
 
   return NS_OK;
 }
 
 nsresult
 ChannelMediaResource::OnStopRequest(nsIRequest* aRequest, nsresult aStatus)
 {
   NS_ASSERTION(mChannel.get() == aRequest, "Wrong channel!");
@@ -427,19 +429,19 @@ nsresult
 ChannelMediaResource::CopySegmentToCache(nsIPrincipal* aPrincipal,
                                          const char* aFromSegment,
                                          uint32_t aCount,
                                          uint32_t* aWriteCount)
 {
   mCallback->NotifyDataArrived();
 
   // Keep track of where we're up to.
-  CMLOG("CopySegmentToCache at mOffset [%" PRId64 "] add "
-        "[%d] bytes for decoder[%p]",
-        mOffset, aCount, mCallback.get());
+  LOG("CopySegmentToCache at mOffset [%" PRId64 "] add "
+      "[%d] bytes for decoder[%p]",
+      mOffset, aCount, mCallback.get());
   mOffset += aCount;
   mCacheStream.NotifyDataReceived(aCount, aFromSegment, aPrincipal);
   *aWriteCount = aCount;
   return NS_OK;
 }
 
 
 struct CopySegmentClosure {
@@ -902,18 +904,18 @@ ChannelMediaResource::CacheClientNotifyS
   mCallback->NotifySuspendedStatusChanged();
 }
 
 nsresult
 ChannelMediaResource::CacheClientSeek(int64_t aOffset, bool aResume)
 {
   NS_ASSERTION(NS_IsMainThread(), "Don't call on non-main thread");
 
-  CMLOG("CacheClientSeek requested for aOffset [%" PRId64 "] for decoder [%p]",
-        aOffset, mCallback.get());
+  LOG("CacheClientSeek requested for aOffset [%" PRId64 "] for decoder [%p]",
+      aOffset, mCallback.get());
 
   CloseChannel();
 
   mOffset = aOffset;
 
   // Don't report close of the channel because the channel is not closed for
   // download ended, but for internal changes in the read position.
   mIgnoreClose = true;
@@ -1655,8 +1657,10 @@ MediaResourceIndex::Seek(int32_t aWhence
 
   mOffset = aOffset;
 
   return NS_OK;
 }
 
 } // namespace mozilla
 
+// avoid redefined macro in unified build
+#undef LOG