Bug 1298173 - Remove redundant parameter. r=dvander draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 20 Sep 2016 16:39:13 -0400
changeset 415666 f8be72889252ae4c0047a40238111128ad9779ad
parent 415495 62f79d676e0e11b3ad59a5425b3ebb3ec5bbefb5
child 415667 1fff2f95a91c9884b099ca707bf3cc893c17cddc
push id29931
push userkgupta@mozilla.com
push dateTue, 20 Sep 2016 20:40:10 +0000
reviewersdvander
bugs1298173, 1020199
milestone52.0a1
Bug 1298173 - Remove redundant parameter. r=dvander The parameter is always true if the tap type is a eSingleTap and false in all other cases, so it's redundant. As it was added as an optimization in bug 1020199 removing it should be safe. MozReview-Commit-ID: CqqJlzKY1jt
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
gfx/layers/apz/util/ContentProcessController.cpp
gfx/layers/ipc/APZChild.cpp
gfx/layers/ipc/APZChild.h
gfx/layers/ipc/PAPZ.ipdl
gfx/layers/ipc/RemoteContentController.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1722,32 +1722,31 @@ TabChild::HandleDoubleTap(const CSSPoint
 
     mApzcTreeManager->ZoomToRect(guid, zoomToRect, DEFAULT_BEHAVIOR);
   }
 }
 
 void
 TabChild::HandleTap(GeckoContentController::TapType aType,
                     const LayoutDevicePoint& aPoint, const Modifiers& aModifiers,
-                    const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId,
-                    bool aCallTakeFocusForClickFromTap)
+                    const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId)
 {
   nsCOMPtr<nsIPresShell> presShell = GetPresShell();
   if (!presShell) {
     return;
   }
   if (!presShell->GetPresContext()) {
     return;
   }
   CSSToLayoutDeviceScale scale(presShell->GetPresContext()->CSSToDevPixelScale());
   CSSPoint point = APZCCallbackHelper::ApplyCallbackTransform(aPoint / scale, aGuid);
 
   switch (aType) {
   case GeckoContentController::TapType::eSingleTap:
-    if (aCallTakeFocusForClickFromTap && mRemoteFrame) {
+    if (mRemoteFrame) {
       mRemoteFrame->SendTakeFocusForClickFromTap();
     }
     if (mGlobal && mTabChildGlobal) {
       mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid);
     }
     break;
   case GeckoContentController::TapType::eDoubleTap:
     HandleDoubleTap(point, aModifiers, aGuid);
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -625,18 +625,17 @@ public:
                                  uint64_t aInputBlockId,
                                  bool aPreventDefault) const;
   void SetTargetAPZC(uint64_t aInputBlockId,
                     const nsTArray<ScrollableLayerGuid>& aTargets) const;
   void HandleTap(layers::GeckoContentController::TapType aType,
                  const LayoutDevicePoint& aPoint,
                  const Modifiers& aModifiers,
                  const mozilla::layers::ScrollableLayerGuid& aGuid,
-                 const uint64_t& aInputBlockId,
-                 bool aCallTakeFocusForClickFromTap);
+                 const uint64_t& aInputBlockId);
   void SetAllowedTouchBehavior(uint64_t aInputBlockId,
                                const nsTArray<TouchBehaviorFlags>& aFlags) const;
 
   bool UpdateFrame(const FrameMetrics& aFrameMetrics);
   bool NotifyAPZStateChange(const ViewID& aViewId,
                             const layers::GeckoContentController::APZStateChange& aChange,
                             const int& aArg);
   void StartScrollbarDrag(const layers::AsyncDragMetrics& aDragMetrics);
--- a/gfx/layers/apz/util/ContentProcessController.cpp
+++ b/gfx/layers/apz/util/ContentProcessController.cpp
@@ -136,17 +136,17 @@ ContentProcessController::HandleTap(
                         TapType aType,
                         const LayoutDevicePoint& aPoint,
                         Modifiers aModifiers,
                         const ScrollableLayerGuid& aGuid,
                         uint64_t aInputBlockId)
 {
   if (mBrowser) {
     mBrowser->HandleTap(aType, aPoint - mBrowser->GetChromeDisplacement(), aModifiers, aGuid,
-        aInputBlockId, (aType == TapType::eSingleTap));
+        aInputBlockId);
   }
 }
 
 void
 ContentProcessController::NotifyAPZStateChange(
                                   const ScrollableLayerGuid& aGuid,
                                   APZStateChange aChange,
                                   int aArg)
--- a/gfx/layers/ipc/APZChild.cpp
+++ b/gfx/layers/ipc/APZChild.cpp
@@ -38,18 +38,17 @@ APZChild::RecvRequestContentRepaint(cons
   return true;
 }
 
 bool
 APZChild::RecvHandleTap(const TapType& aType,
                         const LayoutDevicePoint& aPoint,
                         const Modifiers& aModifiers,
                         const ScrollableLayerGuid& aGuid,
-                        const uint64_t& aInputBlockId,
-                        const bool& aCallTakeFocusForClickFromTap)
+                        const uint64_t& aInputBlockId)
 {
   mController->HandleTap(aType, aPoint, aModifiers, aGuid,
       aInputBlockId);
   return true;
 }
 
 bool
 APZChild::RecvUpdateOverscrollVelocity(const float& aX, const float& aY, const bool& aIsRootContent)
--- a/gfx/layers/ipc/APZChild.h
+++ b/gfx/layers/ipc/APZChild.h
@@ -26,18 +26,17 @@ public:
   ~APZChild();
 
   bool RecvRequestContentRepaint(const FrameMetrics& frame) override;
 
   bool RecvHandleTap(const TapType& aType,
                      const LayoutDevicePoint& aPoint,
                      const Modifiers& aModifiers,
                      const ScrollableLayerGuid& aGuid,
-                     const uint64_t& aInputBlockId,
-                     const bool& aCallTakeFocusForClickFromTap) override;
+                     const uint64_t& aInputBlockId) override;
 
   bool RecvUpdateOverscrollVelocity(const float& aX, const float& aY, const bool& aIsRootContent) override;
 
   bool RecvUpdateOverscrollOffset(const float& aX, const float& aY, const bool& aIsRootContent) override;
 
   bool RecvSetScrollingRootContent(const bool& aIsRootContent) override;
 
   bool RecvNotifyMozMouseScrollEvent(const ViewID& aScrollId,
--- a/gfx/layers/ipc/PAPZ.ipdl
+++ b/gfx/layers/ipc/PAPZ.ipdl
@@ -52,22 +52,18 @@ parent:
   async UpdateHitRegion(nsRegion aRegion);
 
   async __delete__();
 
 child:
 
   async RequestContentRepaint(FrameMetrics frame);
 
-  // The aCallTakeFocusForClickFromTap argument is used for eSingleTap types,
-  // to request that the child take focus before dispatching the mouse events
-  // for the tap (otherwise the resulting focus behaviour is incorrect).
   async HandleTap(TapType aType, LayoutDevicePoint point, Modifiers aModifiers,
-                  ScrollableLayerGuid aGuid, uint64_t aInputBlockId,
-                  bool aCallTakeFocusForClickFromTap);
+                  ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
 
   async UpdateOverscrollVelocity(float aX, float aY, bool aIsRootContent);
 
   async UpdateOverscrollOffset(float aX, float aY, bool aIsRootContent);
 
   async SetScrollingRootContent(bool aIsRootContent);
 
   async NotifyMozMouseScrollEvent(ViewID aScrollId, nsString aEvent);
--- a/gfx/layers/ipc/RemoteContentController.cpp
+++ b/gfx/layers/ipc/RemoteContentController.cpp
@@ -59,21 +59,19 @@ RemoteContentController::HandleTap(TapTy
     mCompositorThread->PostTask(NewRunnableMethod<TapType, LayoutDevicePoint, Modifiers,
                                         ScrollableLayerGuid, uint64_t>(this,
                                           &RemoteContentController::HandleTap,
                                           aTapType, aPoint, aModifiers, aGuid,
                                           aInputBlockId));
     return;
   }
 
-  bool callTakeFocusForClickFromTap = (aTapType == TapType::eSingleTap);
-
   if (mCanSend) {
     Unused << SendHandleTap(aTapType, aPoint,
-            aModifiers, aGuid, aInputBlockId, callTakeFocusForClickFromTap);
+            aModifiers, aGuid, aInputBlockId);
   }
 }
 
 void
 RemoteContentController::PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs)
 {
 #ifdef MOZ_WIDGET_ANDROID
   AndroidBridge::Bridge()->PostTaskToUiThread(Move(aTask), aDelayMs);