mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-29 21:25:35 +00:00
Bug 881959 - Fix inbound bustage on XP.
This commit is contained in:
parent
9990b314dd
commit
1b7d26c1ad
@ -465,38 +465,37 @@ MediaStreamGraphImpl::MarkConsumed(MediaStream* aStream)
|
||||
}
|
||||
}
|
||||
|
||||
class MediaStreamGraphWarnCycleRunnable : public nsRunnable {
|
||||
public:
|
||||
explicit MediaStreamGraphWarnCycleRunnable(MediaStream* aStream)
|
||||
: mStream(aStream)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
AudioNodeEngine* engine = mStream->AsAudioNodeStream()->Engine();
|
||||
MutexAutoLock mon(engine->NodeMutex());
|
||||
AudioNode* node = engine->Node();
|
||||
nsCOMPtr<nsPIDOMWindow> pWindow = do_QueryInterface(node->Context()->GetParentObject());
|
||||
nsIDocument* doc = nullptr;
|
||||
if (pWindow) {
|
||||
doc = pWindow->GetExtantDoc();
|
||||
}
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
|
||||
NS_LITERAL_CSTRING("Media"),
|
||||
doc,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
"AudioNodeCycleWithoutDelay");
|
||||
return NS_OK;
|
||||
}
|
||||
private:
|
||||
MediaStream* mStream;
|
||||
};
|
||||
|
||||
static void
|
||||
WarnIllegalCycle(MediaStream* aStream)
|
||||
{
|
||||
class MediaStreamGraphWarnCycleRunnable : public nsRunnable {
|
||||
public:
|
||||
explicit MediaStreamGraphWarnCycleRunnable(MediaStream* aStream)
|
||||
: mStream(aStream)
|
||||
{
|
||||
}
|
||||
|
||||
nsresult Run()
|
||||
{
|
||||
AudioNodeEngine* engine = mStream->AsAudioNodeStream()->Engine();
|
||||
MutexAutoLock mon(engine->NodeMutex());
|
||||
AudioNode* node = engine->Node();
|
||||
nsCOMPtr<nsPIDOMWindow> pWindow = do_QueryInterface(node->Context()->GetParentObject());
|
||||
nsIDocument* doc = nullptr;
|
||||
if (pWindow) {
|
||||
doc = pWindow->GetExtantDoc();
|
||||
}
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
|
||||
NS_LITERAL_CSTRING("Media"),
|
||||
doc,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
"AudioNodeCycleWithoutDelay");
|
||||
return NS_OK;
|
||||
}
|
||||
private:
|
||||
MediaStream* mStream;
|
||||
};
|
||||
|
||||
nsCOMPtr<nsIRunnable> event = new MediaStreamGraphWarnCycleRunnable(aStream);
|
||||
NS_DispatchToMainThread(event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user