Bug 1272930 - Fix some -Wshadow warnings in dom/media/systemservices. r=gerald

dom/media/systemservices/MediaSystemResourceManager.cpp:71:33 [-Wshadow] declaration shadows a local variable
dom/media/systemservices/MediaUtils.h:85:32 [-Wshadow] declaration shadows a local variable
dom/media/systemservices/MediaUtils.h:85:60 [-Wshadow] declaration shadows a local variable
dom/media/systemservices/MediaParent.cpp:250:19 [-Wshadow-local] declaration of 'buffer' shadows a previous local
dom/media/systemservices/MediaParent.cpp:258:18 [-Wshadow-compatible-local] declaration of 'count' shadows a previous local
dom/media/systemservices/MediaParent.cpp:259:18 [-Wshadow-compatible-local] declaration of 'rv' shadows a previous local
This commit is contained in:
Chris Peterson 2016-05-14 18:41:52 -07:00
Родитель e7fc680f63
Коммит 2674f069a9
3 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -228,16 +228,17 @@ class OriginKeyStore : public nsISupports
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsAutoCString buffer;
buffer.AppendLiteral(ORIGINKEYS_VERSION);
buffer.Append('\n');
nsAutoCString versionBuffer;
versionBuffer.AppendLiteral(ORIGINKEYS_VERSION);
versionBuffer.Append('\n');
uint32_t count;
rv = stream->Write(buffer.Data(), buffer.Length(), &count);
rv = stream->Write(versionBuffer.Data(), versionBuffer.Length(), &count);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (count != buffer.Length()) {
if (count != versionBuffer.Length()) {
return NS_ERROR_UNEXPECTED;
}
for (auto iter = mKeys.Iter(); !iter.Done(); iter.Next()) {
@ -247,17 +248,17 @@ class OriginKeyStore : public nsISupports
if (!originKey->mSecondsStamp) {
continue; // don't write temporal ones
}
nsCString buffer;
buffer.Append(originKey->mKey);
buffer.Append(' ');
buffer.AppendInt(originKey->mSecondsStamp);
buffer.Append(' ');
buffer.Append(origin);
buffer.Append('\n');
uint32_t count;
nsresult rv = stream->Write(buffer.Data(), buffer.Length(), &count);
if (NS_WARN_IF(NS_FAILED(rv)) || count != buffer.Length()) {
nsCString originBuffer;
originBuffer.Append(originKey->mKey);
originBuffer.Append(' ');
originBuffer.AppendInt(originKey->mSecondsStamp);
originBuffer.Append(' ');
originBuffer.Append(origin);
originBuffer.Append('\n');
rv = stream->Write(originBuffer.Data(), originBuffer.Length(), &count);
if (NS_WARN_IF(NS_FAILED(rv)) || count != originBuffer.Length()) {
break;
}
}

Просмотреть файл

@ -60,7 +60,7 @@ MediaSystemResourceManager::Init()
}
ReentrantMonitor barrier("MediaSystemResourceManager::Init");
ReentrantMonitorAutoEnter autoMon(barrier);
ReentrantMonitorAutoEnter mainThreadAutoMon(barrier);
bool done = false;
RefPtr<Runnable> runnable =
@ -68,7 +68,7 @@ MediaSystemResourceManager::Init()
if (!sSingleton) {
sSingleton = new MediaSystemResourceManager();
}
ReentrantMonitorAutoEnter autoMon(barrier);
ReentrantMonitorAutoEnter childThreadAutoMon(barrier);
done = true;
barrier.NotifyAll();
});
@ -79,7 +79,6 @@ MediaSystemResourceManager::Init()
while (!done) {
barrier.Wait();
}
}
MediaSystemResourceManager::MediaSystemResourceManager()

Просмотреть файл

@ -82,8 +82,8 @@ public:
class Functors : public FunctorsBase
{
public:
Functors(OnSuccessType&& aOnSuccess, OnFailureType&& aOnFailure)
: mOnSuccess(Move(aOnSuccess)), mOnFailure(Move(aOnFailure)) {}
Functors(OnSuccessType&& aOnSuccessRef, OnFailureType&& aOnFailureRef)
: mOnSuccess(Move(aOnSuccessRef)), mOnFailure(Move(aOnFailureRef)) {}
void Succeed(ValueType& result)
{