зеркало из https://github.com/mozilla/gecko-dev.git
Bug 834513 follow-up: Mode AudioNode::DestroyMediaStream into the cpp file, and inline UnbindFromEngine
This commit is contained in:
Родитель
c67aa61e5f
Коммит
5ddf6abea4
|
@ -202,12 +202,18 @@ AudioNode::Disconnect(uint32_t aOutput, ErrorResult& aRv)
|
|||
}
|
||||
|
||||
void
|
||||
AudioNode::UnbindFromEngine()
|
||||
AudioNode::DestroyMediaStream()
|
||||
{
|
||||
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
|
||||
MOZ_ASSERT(ns, "How come we don't have a stream here?");
|
||||
MOZ_ASSERT(ns->Engine()->mNode == this, "Invalid node reference");
|
||||
ns->Engine()->mNode = nullptr;
|
||||
if (mStream) {
|
||||
// Remove the node reference on the engine
|
||||
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
|
||||
MOZ_ASSERT(ns, "How come we don't have a stream here?");
|
||||
MOZ_ASSERT(ns->Engine()->mNode == this, "Invalid node reference");
|
||||
ns->Engine()->mNode = nullptr;
|
||||
|
||||
mStream->Destroy();
|
||||
mStream = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -78,14 +78,7 @@ public:
|
|||
virtual ~AudioNode();
|
||||
|
||||
// This should be idempotent (safe to call multiple times).
|
||||
virtual void DestroyMediaStream()
|
||||
{
|
||||
if (mStream) {
|
||||
UnbindFromEngine();
|
||||
mStream->Destroy();
|
||||
mStream = nullptr;
|
||||
}
|
||||
}
|
||||
virtual void DestroyMediaStream();
|
||||
|
||||
// This method should be overridden to return true in nodes
|
||||
// which support being hooked up to the Media Stream graph.
|
||||
|
@ -151,8 +144,6 @@ private:
|
|||
// This could possibly delete 'this'.
|
||||
void DisconnectFromGraph();
|
||||
|
||||
void UnbindFromEngine();
|
||||
|
||||
protected:
|
||||
static void Callback(AudioNode* aNode) { /* not implemented */ }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче