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