Bug 1076915 - Ensure that PostDelayedTask is always called on the controller thread. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 03 Oct 2014 09:29:49 -0400
changeset 208694 e4165ab15b4e70f99afd4e429f3f429eb0e61463
parent 208693 e5b574a8db51e1e1d3be5e39494bd4955f32bc1e
child 208695 696baf50aabd5185d3b4e937f83a8fd8897ad3c2
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbotond
bugs1076915
milestone35.0a1
Bug 1076915 - Ensure that PostDelayedTask is always called on the controller thread. r=botond
gfx/layers/apz/public/GeckoContentController.h
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- 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();