Bug 1435022 - Minor cleanup on the Destroy function. r=sotaro

MozReview-Commit-ID: EnE6JKKmhgy

--HG--
extra : rebase_source : 49e11327c77968e649ae28bee7e5a72bc2a6f98a
This commit is contained in:
Kartikaya Gupta 2018-02-01 16:28:53 -05:00
parent b90ff6039c
commit 88a5174812
2 changed files with 6 additions and 1 deletions

View File

@ -106,11 +106,12 @@ CompositorVsyncScheduler::~CompositorVsyncScheduler()
void
CompositorVsyncScheduler::Destroy()
{
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
if (!mVsyncObserver) {
// Destroy was already called on this object.
return;
}
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
UnobserveVsync();
mVsyncObserver->Destroy();
mVsyncObserver = nullptr;

View File

@ -51,7 +51,11 @@ public:
bool NotifyVsync(TimeStamp aVsyncTimestamp);
void SetNeedsComposite();
/**
* Do cleanup. This must be called on the compositor thread.
*/
void Destroy();
void ScheduleComposition();
void CancelCurrentCompositeTask();
bool NeedsComposite();