Bug 1298173 - Remove redundant parameter. r=dvander a=gchang
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 21 Sep 2016 10:25:05 -0400
changeset 355798 eda2ba9ceb011ea8f1d86866461a990c38166ee4
parent 355797 eab6700676c1f377e51cd18db028e477517053d0
child 355799 277a0cbc72e6934a44648db21cd8ae3c909aa663
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, gchang
bugs1298173, 1020199
milestone51.0a2
Bug 1298173 - Remove redundant parameter. r=dvander a=gchang 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: IPB8BUagQl6
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
@@ -1724,32 +1724,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);