зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1415762 - Cancel VRListener task when CompositorVsyncScheduler is going to destroy; r=dvander
MozReview-Commit-ID: CB5JrDGZTu1 --HG-- extra : rebase_source : 4a6f65f4aaf2c11f2dad1a471f0cb219470f1dbe
This commit is contained in:
Родитель
3d64658419
Коммит
204ca9c9df
|
@ -117,6 +117,7 @@ CompositorVsyncScheduler::Destroy()
|
|||
|
||||
CancelCurrentSetNeedsCompositeTask();
|
||||
CancelCurrentCompositeTask();
|
||||
CancelCurrentVRTask();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -133,6 +134,7 @@ CompositorVsyncScheduler::PostCompositeTask(TimeStamp aCompositeTimestamp)
|
|||
mCurrentCompositeTask = task;
|
||||
ScheduleTask(task.forget(), 0);
|
||||
}
|
||||
MonitorAutoLock lockVR(mCurrentVRListenerTaskMonitor);
|
||||
if (mCurrentVRListenerTask == nullptr && VRListenerThreadHolder::Loop()) {
|
||||
RefPtr<CancelableRunnable> task = NewCancelableRunnableMethod<TimeStamp>(
|
||||
"layers::CompositorVsyncScheduler::DispatchVREvents",
|
||||
|
@ -242,6 +244,18 @@ CompositorVsyncScheduler::CancelCurrentCompositeTask()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
CompositorVsyncScheduler::CancelCurrentVRTask()
|
||||
{
|
||||
// This function is only called by CompositorVsyncScheduler::Destroy().
|
||||
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
|
||||
MonitorAutoLock lockVR(mCurrentVRListenerTaskMonitor);
|
||||
if (mCurrentVRListenerTask) {
|
||||
mCurrentVRListenerTask->Cancel();
|
||||
mCurrentVRListenerTask = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp)
|
||||
{
|
||||
|
|
|
@ -83,6 +83,7 @@ private:
|
|||
void DispatchTouchEvents(TimeStamp aVsyncTimestamp);
|
||||
void DispatchVREvents(TimeStamp aVsyncTimestamp);
|
||||
void CancelCurrentSetNeedsCompositeTask();
|
||||
void CancelCurrentVRTask();
|
||||
|
||||
class Observer final : public VsyncObserver
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
static VRListenerThreadHolder* GetSingleton();
|
||||
|
||||
static bool IsActive() {
|
||||
return !!GetSingleton();
|
||||
return GetSingleton() && Loop();
|
||||
}
|
||||
|
||||
static void Start();
|
||||
|
|
Загрузка…
Ссылка в новой задаче