Bug 1124452 - Ensure the widget continues to be destroyed on the main thread. r=BenWa

This commit is contained in:
Kartikaya Gupta
2015-01-29 12:57:55 -05:00
parent d00963ed70
commit c536b29824
5 changed files with 24 additions and 0 deletions

View File

@@ -83,3 +83,17 @@ ChromeProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aSc
{
APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
}
void
ChromeProcessController::Destroy()
{
if (MessageLoop::current() != mUILoop) {
mUILoop->PostTask(
FROM_HERE,
NewRunnableMethod(this, &ChromeProcessController::Destroy));
return;
}
MOZ_ASSERT(MessageLoop::current() == mUILoop);
mWidget = nullptr;
}