mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
b=914030 remove MediaBufferDecoder::Shutdown(), no longer necessary since bug 900711, as part of making AudioContext::Shutdown() idempotent r=ehsan
--HG-- extra : transplant_source : %A8%BB%7D%A3%A6%87NF%F3%9D.Lu%D4%15B%10%9C%DFR
This commit is contained in:
parent
86916b22d2
commit
b5d291c0c7
@ -517,26 +517,11 @@ GetHashtableElements(nsTHashtable<nsPtrHashKey<T> >& aHashtable, nsTArray<T*>& a
|
|||||||
aHashtable.EnumerateEntries(&GetHashtableEntry<T>, &aArray);
|
aHashtable.EnumerateEntries(&GetHashtableEntry<T>, &aArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
AudioContext::ShutdownDecoder()
|
|
||||||
{
|
|
||||||
mDecoder.Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioContext::Shutdown()
|
AudioContext::Shutdown()
|
||||||
{
|
{
|
||||||
Suspend();
|
Suspend();
|
||||||
|
|
||||||
// We need to hold the AudioContext object alive here to make sure that
|
|
||||||
// it doesn't get destroyed before our decoder shutdown runnable has had
|
|
||||||
// a chance to run.
|
|
||||||
nsCOMPtr<nsIRunnable> threadShutdownEvent =
|
|
||||||
NS_NewRunnableMethod(this, &AudioContext::ShutdownDecoder);
|
|
||||||
if (threadShutdownEvent) {
|
|
||||||
NS_DispatchToCurrentThread(threadShutdownEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stop all audio buffer source nodes, to make sure that they release
|
// Stop all audio buffer source nodes, to make sure that they release
|
||||||
// their self-references.
|
// their self-references.
|
||||||
// We first gather an array of the nodes and then call Stop on each one,
|
// We first gather an array of the nodes and then call Stop on each one,
|
||||||
|
@ -572,15 +572,6 @@ MediaBufferDecoder::EnsureThreadPoolInitialized()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
MediaBufferDecoder::Shutdown() {
|
|
||||||
if (mThreadPool) {
|
|
||||||
mThreadPool->Shutdown();
|
|
||||||
mThreadPool = nullptr;
|
|
||||||
}
|
|
||||||
MOZ_ASSERT(!mThreadPool);
|
|
||||||
}
|
|
||||||
|
|
||||||
WebAudioDecodeJob::WebAudioDecodeJob(const nsACString& aContentType,
|
WebAudioDecodeJob::WebAudioDecodeJob(const nsACString& aContentType,
|
||||||
AudioContext* aContext,
|
AudioContext* aContext,
|
||||||
const ArrayBuffer& aBuffer,
|
const ArrayBuffer& aBuffer,
|
||||||
|
@ -80,8 +80,6 @@ public:
|
|||||||
bool SyncDecodeMedia(const char* aContentType, uint8_t* aBuffer,
|
bool SyncDecodeMedia(const char* aContentType, uint8_t* aBuffer,
|
||||||
uint32_t aLength, WebAudioDecodeJob& aDecodeJob);
|
uint32_t aLength, WebAudioDecodeJob& aDecodeJob);
|
||||||
|
|
||||||
void Shutdown();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool EnsureThreadPoolInitialized();
|
bool EnsureThreadPoolInitialized();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user