Bug 1076915 - Ensure that PostDelayedTask is always called on the controller thread. r=botond
--- a/gfx/layers/apz/public/GeckoContentController.h
+++ b/gfx/layers/apz/public/GeckoContentController.h
@@ -82,16 +82,17 @@ public:
*/
virtual void SendAsyncScrollDOMEvent(bool aIsRoot,
const CSSRect &aContentRect,
const CSSSize &aScrollableSize) = 0;
/**
* Schedules a runnable to run on the controller/UI thread at some time
* in the future.
+ * This method must always be called on the controller thread.
*/
virtual void PostDelayedTask(Task* aTask, int aDelayMs) = 0;
/**
* Retrieves the last known zoom constraints for the root scrollable layer
* for this layers tree. This function should return false if there are no
* last known zoom constraints.
*/
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -3133,16 +3133,17 @@ void AsyncPanZoomController::UpdateZoomC
ZoomConstraints
AsyncPanZoomController::GetZoomConstraints() const
{
return mZoomConstraints;
}
void AsyncPanZoomController::PostDelayedTask(Task* aTask, int aDelayMs) {
+ AssertOnControllerThread();
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
if (controller) {
controller->PostDelayedTask(aTask, aDelayMs);
}
}
void AsyncPanZoomController::SendAsyncScrollEvent() {
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();