bug 916387 keep ScriptProcessorNode alive after input is GCed r=padenot

--HG--
extra : rebase_source : a9f5d8f4c33845d1548c2daf53d7aced6d6e668b
This commit is contained in:
Karl Tomlinson 2015-08-06 17:56:06 +12:00
Родитель fda85fcc8b
Коммит 3a15b165c6
2 изменённых файлов: 10 добавлений и 2 удалений

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

@ -568,8 +568,9 @@ ScriptProcessorNode::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProt
void void
ScriptProcessorNode::UpdateConnectedStatus() ScriptProcessorNode::UpdateConnectedStatus()
{ {
bool isConnected = !(OutputNodes().IsEmpty() && OutputParams().IsEmpty() bool isConnected = mHasPhantomInput ||
&& InputNodes().IsEmpty()); !(OutputNodes().IsEmpty() && OutputParams().IsEmpty()
&& InputNodes().IsEmpty());
// Events are queued even when there is no listener because a listener // Events are queued even when there is no listener because a listener
// may be added while events are in the queue. // may be added while events are in the queue.

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

@ -62,6 +62,12 @@ public:
{ {
UpdateConnectedStatus(); UpdateConnectedStatus();
} }
virtual void NotifyHasPhantomInput() override
{
mHasPhantomInput = true;
// No need to UpdateConnectedStatus() because there was previously an
// input in InputNodes().
}
virtual void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override virtual void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override
{ {
@ -105,6 +111,7 @@ private:
const uint32_t mBufferSize; const uint32_t mBufferSize;
const uint32_t mNumberOfOutputChannels; const uint32_t mNumberOfOutputChannels;
bool mHasPhantomInput = false;
}; };
} // namespace dom } // namespace dom