Bug 1390321 - Remove the no-longer-used IAPZCTreeManager::CancelAnimation() function. r=kats draft
authorBotond Ballo <botond@mozilla.com>
Mon, 14 Aug 2017 17:12:22 -0400
changeset 646108 788e5be8be5547d72a7d82feca8141228153a6fe
parent 646107 167623dc79379e734b6c2e8230fd0e7021c1303f
child 726143 d019611d52d886a06a936f28b8b8e8b14040d745
push id74011
push userbballo@mozilla.com
push dateMon, 14 Aug 2017 21:56:32 +0000
reviewerskats
bugs1390321
milestone57.0a1
Bug 1390321 - Remove the no-longer-used IAPZCTreeManager::CancelAnimation() function. r=kats MozReview-Commit-ID: Ln7zJPnSUvV
gfx/layers/apz/public/IAPZCTreeManager.h
gfx/layers/apz/src/APZCTreeManager.h
gfx/layers/ipc/APZCTreeManagerChild.cpp
gfx/layers/ipc/APZCTreeManagerChild.h
gfx/layers/ipc/APZCTreeManagerParent.cpp
gfx/layers/ipc/APZCTreeManagerParent.h
gfx/layers/ipc/PAPZCTreeManager.ipdl
--- a/gfx/layers/apz/public/IAPZCTreeManager.h
+++ b/gfx/layers/apz/public/IAPZCTreeManager.h
@@ -152,23 +152,16 @@ public:
    * Updates any zoom constraints contained in the <meta name="viewport"> tag.
    * If the |aConstraints| is Nothing() then previously-provided constraints for
    * the given |aGuid| are cleared.
    */
   virtual void UpdateZoomConstraints(
       const ScrollableLayerGuid& aGuid,
       const Maybe<ZoomConstraints>& aConstraints) = 0;
 
-  /**
-   * Cancels any currently running animation. Note that all this does is set the
-   * state of the AsyncPanZoomController back to NOTHING, but it is the
-   * animation's responsibility to check this before advancing.
-   */
-  virtual void CancelAnimation(const ScrollableLayerGuid &aGuid) = 0;
-
   virtual void SetDPI(float aDpiValue) = 0;
 
   /**
    * Sets allowed touch behavior values for current touch-session for specific
    * input block (determined by aInputBlock).
    * Should be invoked by the widget. Each value of the aValues arrays
    * corresponds to the different touch point that is currently active.
    * Must be called after receiving the TOUCH_START event that starts the
--- a/gfx/layers/apz/src/APZCTreeManager.h
+++ b/gfx/layers/apz/src/APZCTreeManager.h
@@ -279,21 +279,19 @@ public:
    * If the |aConstraints| is Nothing() then previously-provided constraints for
    * the given |aGuid| are cleared.
    */
   void UpdateZoomConstraints(
       const ScrollableLayerGuid& aGuid,
       const Maybe<ZoomConstraints>& aConstraints) override;
 
   /**
-   * Cancels any currently running animation. Note that all this does is set the
-   * state of the AsyncPanZoomController back to NOTHING, but it is the
-   * animation's responsibility to check this before advancing.
+   * Cancels any currently running animation.
    */
-  void CancelAnimation(const ScrollableLayerGuid &aGuid) override;
+  void CancelAnimation(const ScrollableLayerGuid &aGuid);
 
   /**
    * Adjusts the root APZC to compensate for a shift in the surface. See the
    * documentation on AsyncPanZoomController::AdjustScrollForSurfaceShift for
    * some more details. This is only currently needed due to surface shifts
    * caused by the dynamic toolbar on Android.
    */
   void AdjustScrollForSurfaceShift(const ScreenPoint& aShift);
--- a/gfx/layers/ipc/APZCTreeManagerChild.cpp
+++ b/gfx/layers/ipc/APZCTreeManagerChild.cpp
@@ -175,22 +175,16 @@ void
 APZCTreeManagerChild::UpdateZoomConstraints(
     const ScrollableLayerGuid& aGuid,
     const Maybe<ZoomConstraints>& aConstraints)
 {
   SendUpdateZoomConstraints(aGuid, aConstraints);
 }
 
 void
-APZCTreeManagerChild::CancelAnimation(const ScrollableLayerGuid &aGuid)
-{
-  SendCancelAnimation(aGuid);
-}
-
-void
 APZCTreeManagerChild::SetDPI(float aDpiValue)
 {
   SendSetDPI(aDpiValue);
 }
 
 void
 APZCTreeManagerChild::SetAllowedTouchBehavior(
     uint64_t aInputBlockId,
--- a/gfx/layers/ipc/APZCTreeManagerChild.h
+++ b/gfx/layers/ipc/APZCTreeManagerChild.h
@@ -50,19 +50,16 @@ public:
           const nsTArray<ScrollableLayerGuid>& aTargets) override;
 
   void
   UpdateZoomConstraints(
           const ScrollableLayerGuid& aGuid,
           const Maybe<ZoomConstraints>& aConstraints) override;
 
   void
-  CancelAnimation(const ScrollableLayerGuid &aGuid) override;
-
-  void
   SetDPI(float aDpiValue) override;
 
   void
   SetAllowedTouchBehavior(
           uint64_t aInputBlockId,
           const nsTArray<TouchBehaviorFlags>& aValues) override;
 
   void
--- a/gfx/layers/ipc/APZCTreeManagerParent.cpp
+++ b/gfx/layers/ipc/APZCTreeManagerParent.cpp
@@ -237,29 +237,16 @@ APZCTreeManagerParent::RecvUpdateZoomCon
     return IPC_FAIL_NO_REASON(this);
   }
 
   mTreeManager->UpdateZoomConstraints(aGuid, aConstraints);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-APZCTreeManagerParent::RecvCancelAnimation(const ScrollableLayerGuid& aGuid)
-{
-  if (aGuid.mLayersId != mLayersId) {
-    // Guard against bad data from hijacked child processes
-    NS_ERROR("Unexpected layers id in RecvCancelAnimation; dropping message...");
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  mTreeManager->CancelAnimation(aGuid);
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
 APZCTreeManagerParent::RecvSetDPI(const float& aDpiValue)
 {
   mTreeManager->SetDPI(aDpiValue);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 APZCTreeManagerParent::RecvSetAllowedTouchBehavior(
--- a/gfx/layers/ipc/APZCTreeManagerParent.h
+++ b/gfx/layers/ipc/APZCTreeManagerParent.h
@@ -106,19 +106,16 @@ public:
           nsTArray<ScrollableLayerGuid>&& aTargets) override;
 
   mozilla::ipc::IPCResult
   RecvUpdateZoomConstraints(
           const ScrollableLayerGuid& aGuid,
           const MaybeZoomConstraints& aConstraints) override;
 
   mozilla::ipc::IPCResult
-  RecvCancelAnimation(const ScrollableLayerGuid& aGuid) override;
-
-  mozilla::ipc::IPCResult
   RecvSetDPI(const float& aDpiValue) override;
 
   mozilla::ipc::IPCResult
   RecvSetAllowedTouchBehavior(
           const uint64_t& aInputBlockId,
           nsTArray<TouchBehaviorFlags>&& aValues) override;
 
   mozilla::ipc::IPCResult
--- a/gfx/layers/ipc/PAPZCTreeManager.ipdl
+++ b/gfx/layers/ipc/PAPZCTreeManager.ipdl
@@ -66,18 +66,16 @@ parent:
   async ZoomToRect(ScrollableLayerGuid aGuid, CSSRect aRect, uint32_t Flags);
 
   async ContentReceivedInputBlock(uint64_t aInputBlockId, bool PreventDefault);
 
   async SetTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] Targets);
 
   async UpdateZoomConstraints(ScrollableLayerGuid aGuid, MaybeZoomConstraints aConstraints);
 
-  async CancelAnimation(ScrollableLayerGuid aGuid);
-
   async SetKeyboardMap(KeyboardMap aKeyboardMap);
 
   async SetDPI(float aDpiValue);
 
   async SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aValues);
 
   async StartScrollbarDrag(ScrollableLayerGuid aGuid, AsyncDragMetrics aDragMetrics);