Bug 1078354 - Part 1 - Make sure we are not waking up an OfflineGraphDriver. r=jesup

I still want to assert in the method instead of making it a no-op because I'm
going to work on AudioContext sleep and wakeup soon, and this will catch errors.

--HG--
extra : rebase_source : dd5ea81c6c2c3eb85c89b95995bc436ed840b979
This commit is contained in:
Paul Adenot 2014-10-20 18:06:10 +02:00
parent 61970d7604
commit 3ab258baba
2 changed files with 13 additions and 2 deletions

View File

@ -67,6 +67,7 @@ typedef int64_t GraphTime;
const GraphTime GRAPH_TIME_MAX = MEDIA_TIME_MAX;
class AudioCallbackDriver;
class OfflineClockDriver;
/**
* A driver is responsible for the scheduling of the processing, the thread
@ -154,6 +155,10 @@ public:
return nullptr;
}
virtual OfflineClockDriver* AsOfflineClockDriver() {
return nullptr;
}
/**
* Tell the driver it has to stop and return the current time of the graph, so
* another driver can start from the right point in time.
@ -306,6 +311,9 @@ public:
virtual void WaitForNextIteration() MOZ_OVERRIDE;
virtual void WakeUp() MOZ_OVERRIDE;
virtual TimeStamp GetCurrentTimeStamp() MOZ_OVERRIDE;
virtual OfflineClockDriver* AsOfflineClockDriver() {
return this;
}
private:
// Time, in GraphTime, for each iteration

View File

@ -2862,9 +2862,12 @@ MediaStreamGraphImpl::CollectReports(nsIHandleReportCallback* aHandleReport,
mNeedsMemoryReport = true;
{
// Wake up the MSG thread.
// Wake up the MSG thread if it's real time (Offline graphs can't be
// sleeping).
MonitorAutoLock monitorLock(mMonitor);
CurrentDriver()->WakeUp();
if (!CurrentDriver()->AsOfflineClockDriver()) {
CurrentDriver()->WakeUp();
}
}
if (mLifecycleState >= LIFECYCLE_WAITING_FOR_THREAD_SHUTDOWN) {