Bug 1135170 - Remove now-unused state machine scheduler freezing/thawing. r=mattwoodrow

This commit is contained in:
Bobby Holley 2015-03-02 18:24:21 -08:00
Родитель 578cad549e
Коммит 4406d389a4
2 изменённых файлов: 1 добавлений и 49 удалений

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

@ -89,15 +89,8 @@ MediaDecoderStateMachineScheduler::Schedule(int64_t aUsecs)
{
mMonitor.AssertCurrentThreadIn();
switch(mState) {
case SCHEDULER_STATE_SHUTDOWN:
if (NS_WARN_IF(mState == SCHEDULER_STATE_SHUTDOWN)) {
return NS_ERROR_FAILURE;
case SCHEDULER_STATE_FROZEN:
mState = SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
case SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK:
return NS_OK;
case SCHEDULER_STATE_NONE:
break;
}
aUsecs = std::max<int64_t>(aUsecs, 0);
@ -168,9 +161,6 @@ void
MediaDecoderStateMachineScheduler::ScheduleAndShutdown()
{
mMonitor.AssertCurrentThreadIn();
if (IsFrozen()) {
ThawScheduling();
}
// Schedule next cycle to handle SHUTDOWN in state machine thread.
Schedule();
// This must be set after calling Schedule()
@ -201,33 +191,4 @@ MediaDecoderStateMachineScheduler::ResetTimer()
mTimeout = TimeStamp();
}
void MediaDecoderStateMachineScheduler::FreezeScheduling()
{
mMonitor.AssertCurrentThreadIn();
if (mState == SCHEDULER_STATE_SHUTDOWN) {
return;
}
MOZ_ASSERT(mState == SCHEDULER_STATE_NONE);
mState = !IsScheduled() ? SCHEDULER_STATE_FROZEN :
SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
// Nullify pending timer task if any.
++mTimerId;
mTimeout = TimeStamp();
}
void MediaDecoderStateMachineScheduler::ThawScheduling()
{
mMonitor.AssertCurrentThreadIn();
if (mState == SCHEDULER_STATE_SHUTDOWN) {
return;
}
// We should be in frozen state and no pending timer task.
MOZ_ASSERT(IsFrozen() && !IsScheduled());
bool pendingTask = mState == SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
mState = SCHEDULER_STATE_NONE;
if (pendingTask) {
Schedule();
}
}
} // namespace mozilla

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

@ -21,8 +21,6 @@ class ReentrantMonitor;
class MediaDecoderStateMachineScheduler {
enum State {
SCHEDULER_STATE_NONE,
SCHEDULER_STATE_FROZEN,
SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK,
SCHEDULER_STATE_SHUTDOWN
};
public:
@ -34,8 +32,6 @@ public:
nsresult Schedule(int64_t aUsecs = 0);
void ScheduleAndShutdown();
nsresult TimeoutExpired(int aTimerId);
void FreezeScheduling();
void ThawScheduling();
bool OnStateMachineThread() const;
bool IsScheduled() const;
@ -48,11 +44,6 @@ public:
return mEventTarget;
}
bool IsFrozen() const {
return mState == SCHEDULER_STATE_FROZEN ||
mState == SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
}
private:
~MediaDecoderStateMachineScheduler();
void ResetTimer();