mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1145015 - Part 1: Remove IsValidKey() check in MagicGrallocBufferHandle serializer. r=sotaro, r=nical
There is a data racing problem in IsValidKey() and we don't need to check the index in serializer. The index is always invalid when we alloc new buffer.
This commit is contained in:
parent
89e09b129b
commit
fc1e027e12
@ -147,11 +147,6 @@ ParamTraits<MagicGrallocBufferHandle>::Read(const Message* aMsg,
|
||||
if (sameProcess) {
|
||||
aResult->mGraphicBuffer = SharedBufferManagerParent::GetGraphicBuffer(aResult->mRef);
|
||||
} else {
|
||||
if (SharedBufferManagerChild::GetSingleton()->IsValidKey(index)) {
|
||||
aResult->mGraphicBuffer = SharedBufferManagerChild::GetSingleton()->GetGraphicBuffer(index);
|
||||
}
|
||||
MOZ_ASSERT(!aResult->mGraphicBuffer.get());
|
||||
|
||||
// Deserialize GraphicBuffer
|
||||
#if ANDROID_VERSION >= 19
|
||||
sp<GraphicBuffer> buffer(new GraphicBuffer());
|
||||
|
@ -365,16 +365,5 @@ SharedBufferManagerChild::GetGraphicBuffer(int64_t key)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
SharedBufferManagerChild::IsValidKey(int64_t key)
|
||||
{
|
||||
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
|
||||
if (mBuffers.count(key) != 1) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
} /* namespace layers */
|
||||
} /* namespace mozilla */
|
||||
|
@ -113,8 +113,6 @@ public:
|
||||
android::sp<android::GraphicBuffer> GetGraphicBuffer(int64_t key);
|
||||
#endif
|
||||
|
||||
bool IsValidKey(int64_t key);
|
||||
|
||||
base::Thread* GetThread() const;
|
||||
|
||||
MessageLoop* GetMessageLoop() const;
|
||||
|
Loading…
Reference in New Issue
Block a user