Bug 1341200. Part 1 - satisfy least privilege principle by capturing |mSamplesWaitingForKey| instead of |this|.
MozReview-Commit-ID: A12HdnP8Vbn
--- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
@@ -167,24 +167,19 @@ public:
mDecodeRequest.DisconnectIfExists();
mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
mThroughputLimiter.Flush();
for (auto iter = mDecrypts.Iter(); !iter.Done(); iter.Next()) {
nsAutoPtr<DecryptPromiseRequestHolder>& holder = iter.Data();
holder->DisconnectIfExists();
iter.Remove();
}
- RefPtr<EMEDecryptor> self = this;
+ RefPtr<SamplesWaitingForKey> k = mSamplesWaitingForKey;
return mDecoder->Flush()->Then(mTaskQueue, __func__,
- [self, this]() {
- mSamplesWaitingForKey->Flush();
- },
- [self, this]() {
- mSamplesWaitingForKey->Flush();
- });
+ [k]() { k->Flush(); });
}
RefPtr<DecodePromise> Drain() override
{
MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
MOZ_ASSERT(!mIsShutdown);
MOZ_ASSERT(mDecodePromise.IsEmpty() && !mDecodeRequest.Exists(),
"Must wait for decoding to complete");