зеркало из https://github.com/mozilla/gecko-dev.git
bug 1199559 permit writing to ThreadSharedFloatArrayBufferList when not shared r=padenot
Being able to write to the channel data in the buffer list saves the creator from needing to manage its own pointers to the channel data. --HG-- extra : rebase_source : 02b22b8b2dc2d640bec706433d7f921858fd8ef4
This commit is contained in:
Родитель
d6d7537d63
Коммит
c919923973
|
@ -58,7 +58,7 @@ public:
|
|||
}
|
||||
void* mDataToFree;
|
||||
void (*mFree)(void*);
|
||||
const float* mSampleData;
|
||||
float* mSampleData;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -69,12 +69,21 @@ public:
|
|||
* This can be called on any thread.
|
||||
*/
|
||||
const float* GetData(uint32_t aIndex) const { return mContents[aIndex].mSampleData; }
|
||||
/**
|
||||
* This can be called on any thread, but only when the calling thread is the
|
||||
* only owner.
|
||||
*/
|
||||
float* GetDataForWrite(uint32_t aIndex)
|
||||
{
|
||||
MOZ_ASSERT(!IsShared());
|
||||
return mContents[aIndex].mSampleData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this only during initialization, before the object is handed to
|
||||
* any other thread.
|
||||
*/
|
||||
void SetData(uint32_t aIndex, void* aDataToFree, void (*aFreeFunc)(void*), const float* aData)
|
||||
void SetData(uint32_t aIndex, void* aDataToFree, void (*aFreeFunc)(void*), float* aData)
|
||||
{
|
||||
Storage* s = &mContents[aIndex];
|
||||
if (s->mFree) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче