--- a/dom/media/MemoryBlockCache.cpp
+++ b/dom/media/MemoryBlockCache.cpp
@@ -41,19 +41,17 @@ enum MemoryBlockCacheTelemetryErrors
MemoryBlockCache::MemoryBlockCache(int64_t aContentLength)
// Buffer whole blocks.
: mInitialContentLength((aContentLength >= 0) ? size_t(aContentLength) : 0)
, mMutex("MemoryBlockCache")
, mHasGrown(false)
{
if (aContentLength <= 0) {
- LOG("@%p MemoryBlockCache() "
- "MEMORYBLOCKCACHE_ERRORS='InitUnderuse'",
- this);
+ LOG("MemoryBlockCache() MEMORYBLOCKCACHE_ERRORS='InitUnderuse'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
InitUnderuse);
}
}
MemoryBlockCache::~MemoryBlockCache()
{
size_t sizes = static_cast<size_t>(mCombinedSizes -= mBuffer.Length());
@@ -138,26 +136,26 @@ MemoryBlockCache::EnsureBufferCanContain
return true;
}
nsresult
MemoryBlockCache::Init()
{
MutexAutoLock lock(mMutex);
if (mBuffer.IsEmpty()) {
- LOG("@%p Init()", this);
+ LOG("Init()");
// Attempt to pre-allocate buffer for expected content length.
if (!EnsureBufferCanContain(mInitialContentLength)) {
- LOG("@%p Init() MEMORYBLOCKCACHE_ERRORS='InitAllocation'", this);
+ LOG("Init() MEMORYBLOCKCACHE_ERRORS='InitAllocation'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
InitAllocation);
return NS_ERROR_FAILURE;
}
} else {
- LOG("@%p Init() again", this);
+ LOG("Init() again");
// Re-initialization - Just erase data.
MOZ_ASSERT(mBuffer.Length() >= mInitialContentLength);
memset(mBuffer.Elements(), 0, mBuffer.Length());
}
// Ignore initial growth.
mHasGrown = false;
return NS_OK;
}
@@ -167,26 +165,22 @@ MemoryBlockCache::WriteBlock(uint32_t aB
Span<const uint8_t> aData1,
Span<const uint8_t> aData2)
{
MutexAutoLock lock(mMutex);
size_t offset = BlockIndexToOffset(aBlockIndex);
if (offset + aData1.Length() + aData2.Length() > mBuffer.Length() &&
!mHasGrown) {
- LOG("@%p WriteBlock() "
- "MEMORYBLOCKCACHE_ERRORS='WriteBlockOverflow'",
- this);
+ LOG("WriteBlock() MEMORYBLOCKCACHE_ERRORS='WriteBlockOverflow'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
WriteBlockOverflow);
}
if (!EnsureBufferCanContain(offset + aData1.Length() + aData2.Length())) {
- LOG("%p WriteBlock() "
- "MEMORYBLOCKCACHE_ERRORS='WriteBlockCannotGrow'",
- this);
+ LOG("WriteBlock() MEMORYBLOCKCACHE_ERRORS='WriteBlockCannotGrow'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
WriteBlockCannotGrow);
return NS_ERROR_FAILURE;
}
memcpy(mBuffer.Elements() + offset, aData1.Elements(), aData1.Length());
if (aData2.Length() > 0) {
memcpy(mBuffer.Elements() + offset + aData1.Length(),
@@ -202,17 +196,17 @@ MemoryBlockCache::Read(int64_t aOffset,
uint8_t* aData,
int32_t aLength,
int32_t* aBytes)
{
MutexAutoLock lock(mMutex);
MOZ_ASSERT(aOffset >= 0);
if (aOffset + aLength > int64_t(mBuffer.Length())) {
- LOG("@%p Read() MEMORYBLOCKCACHE_ERRORS='ReadOverrun'", this);
+ LOG("Read() MEMORYBLOCKCACHE_ERRORS='ReadOverrun'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
ReadOverrun);
return NS_ERROR_FAILURE;
}
memcpy(aData, mBuffer.Elements() + aOffset, aLength);
*aBytes = aLength;
@@ -222,34 +216,28 @@ MemoryBlockCache::Read(int64_t aOffset,
nsresult
MemoryBlockCache::MoveBlock(int32_t aSourceBlockIndex, int32_t aDestBlockIndex)
{
MutexAutoLock lock(mMutex);
size_t sourceOffset = BlockIndexToOffset(aSourceBlockIndex);
size_t destOffset = BlockIndexToOffset(aDestBlockIndex);
if (sourceOffset + BLOCK_SIZE > mBuffer.Length()) {
- LOG("@%p MoveBlock() "
- "MEMORYBLOCKCACHE_ERRORS='MoveBlockSourceOverrun'",
- this);
+ LOG("MoveBlock() MEMORYBLOCKCACHE_ERRORS='MoveBlockSourceOverrun'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
MoveBlockSourceOverrun);
return NS_ERROR_FAILURE;
}
if (destOffset + BLOCK_SIZE > mBuffer.Length() && !mHasGrown) {
- LOG("@%p MoveBlock() "
- "MEMORYBLOCKCACHE_ERRORS='MoveBlockDestOverflow'",
- this);
+ LOG("MoveBlock() MEMORYBLOCKCACHE_ERRORS='MoveBlockDestOverflow'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
MoveBlockDestOverflow);
}
if (!EnsureBufferCanContain(destOffset + BLOCK_SIZE)) {
- LOG("@%p MoveBlock() "
- "MEMORYBLOCKCACHE_ERRORS='MoveBlockCannotGrow'",
- this);
+ LOG("MoveBlock() MEMORYBLOCKCACHE_ERRORS='MoveBlockCannotGrow'");
Telemetry::Accumulate(Telemetry::HistogramID::MEMORYBLOCKCACHE_ERRORS,
MoveBlockCannotGrow);
return NS_ERROR_FAILURE;
}
memcpy(mBuffer.Elements() + destOffset,
mBuffer.Elements() + sourceOffset,
BLOCK_SIZE);