From c06300e2240e7902ddeac4e1289fe8861388d9df Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 13 Sep 2015 23:51:45 -0700 Subject: [PATCH] Don't run the compositor:created notification from within unsafer callers. (bug 1201684, r=mattwoodrow) --- gfx/thebes/gfxPlatform.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index b696e7b0f10..89a59366b4a 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2484,9 +2484,11 @@ gfxPlatform::NotifyCompositorCreated(LayersBackend aBackend) mCompositorBackend = aBackend; // Notify that we created a compositor, so telemetry can update. - if (nsCOMPtr obsvc = services::GetObserverService()) { - obsvc->NotifyObservers(nullptr, "compositor:created", nullptr); - } + NS_DispatchToMainThread(NS_NewRunnableFunction([] { + if (nsCOMPtr obsvc = services::GetObserverService()) { + obsvc->NotifyObservers(nullptr, "compositor:created", nullptr); + } + })); } void