From 0bbcf4d17c3f2bdabca01caa823682a2c925169c Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Wed, 14 Jan 2015 18:03:43 -0500 Subject: [PATCH] Bug 1124452 - Store the main thread's MessageLoop in ChromeProcessController. r=kats --HG-- extra : rebase_source : 9c163795564dbe2fae1fd3a6e371b6455277d811 --- gfx/layers/apz/util/ChromeProcessController.cpp | 8 +++++++- gfx/layers/apz/util/ChromeProcessController.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gfx/layers/apz/util/ChromeProcessController.cpp b/gfx/layers/apz/util/ChromeProcessController.cpp index 2c130eeafff2..fb27bf8b25cf 100644 --- a/gfx/layers/apz/util/ChromeProcessController.cpp +++ b/gfx/layers/apz/util/ChromeProcessController.cpp @@ -3,7 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "mozilla/layers/ChromeProcessController.h" +#include "ChromeProcessController.h" + +#include "MainThreadUtils.h" // for NS_IsMainThread() +#include "base/message_loop.h" // for MessageLoop #include "mozilla/layers/CompositorParent.h" #include "mozilla/layers/APZCCallbackHelper.h" #include "nsLayoutUtils.h" @@ -14,7 +17,10 @@ using namespace mozilla::widget; ChromeProcessController::ChromeProcessController(nsIWidget* aWidget) : mWidget(aWidget) + , mUILoop(MessageLoop::current()) { + // Otherwise we're initializing mUILoop incorrectly. + MOZ_ASSERT(NS_IsMainThread()); } void diff --git a/gfx/layers/apz/util/ChromeProcessController.h b/gfx/layers/apz/util/ChromeProcessController.h index 23d2d68ec237..3e8966169e15 100644 --- a/gfx/layers/apz/util/ChromeProcessController.h +++ b/gfx/layers/apz/util/ChromeProcessController.h @@ -11,6 +11,8 @@ class nsIWidget; +class MessageLoop; + namespace mozilla { namespace layers { @@ -46,6 +48,7 @@ public: private: nsCOMPtr mWidget; + MessageLoop* mUILoop; }; } // namespace layers