Bug 834513 follow-up: Mode AudioNode::DestroyMediaStream into the cpp file, and inline UnbindFromEngine

This commit is contained in:
Ehsan Akhgari 2013-04-22 22:45:37 -04:00
Родитель c67aa61e5f
Коммит 5ddf6abea4
2 изменённых файлов: 12 добавлений и 15 удалений

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

@ -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 */ }