Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 06 May 2019 22:14:40 +0000
changeset 531641 7748746bf2feda8edd0cabfdaff88b7faf059ad5
parent 531640 a51bea90b88626322cbee00108436736ad09f024
child 531642 18ae393f54167ce4305a7c1192fbc90b594b6361
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1548568
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond Differential Revision: https://phabricator.services.mozilla.com/D29688
dom/ipc/BrowserChild.cpp
dom/ipc/BrowserChild.h
gfx/layers/apz/util/APZEventState.cpp
gfx/layers/apz/util/APZEventState.h
gfx/layers/apz/util/ChromeProcessController.cpp
widget/nsBaseWidget.cpp
--- a/dom/ipc/BrowserChild.cpp
+++ b/dom/ipc/BrowserChild.cpp
@@ -468,18 +468,17 @@ BrowserChild::Observe(nsISupports* aSubj
         APZCCallbackHelper::InitializeRootDisplayport(presShell);
       }
     }
   }
 
   return NS_OK;
 }
 
-void BrowserChild::ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
-                                             uint64_t aInputBlockId,
+void BrowserChild::ContentReceivedInputBlock(uint64_t aInputBlockId,
                                              bool aPreventDefault) const {
   if (mApzcTreeManager) {
     mApzcTreeManager->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
   }
 }
 
 void BrowserChild::SetTargetAPZC(
     uint64_t aInputBlockId,
@@ -594,23 +593,21 @@ nsresult BrowserChild::Init(mozIDOMWindo
 
   nsContentUtils::SetScrollbarsVisibility(
       window->GetDocShell(),
       !!(mChromeFlags & nsIWebBrowserChrome::CHROME_SCROLLBARS));
 
   nsWeakPtr weakPtrThis = do_GetWeakReference(
       static_cast<nsIBrowserChild*>(this));  // for capture by the lambda
   ContentReceivedInputBlockCallback callback(
-      [weakPtrThis](const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId,
-                    bool aPreventDefault) {
+      [weakPtrThis](uint64_t aInputBlockId, bool aPreventDefault) {
         if (nsCOMPtr<nsIBrowserChild> browserChild =
                 do_QueryReferent(weakPtrThis)) {
           static_cast<BrowserChild*>(browserChild.get())
-              ->ContentReceivedInputBlock(aGuid, aInputBlockId,
-                                          aPreventDefault);
+              ->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
         }
       });
   mAPZEventState = new APZEventState(mPuppetWidget, std::move(callback));
 
   mIPCOpen = true;
 
   // Recording/replaying processes use their own compositor.
   if (recordreplay::IsRecordingOrReplaying()) {
@@ -1331,31 +1328,31 @@ mozilla::ipc::IPCResult BrowserChild::Re
   CSSToLayoutDeviceScale scale(
       presShell->GetPresContext()->CSSToDevPixelScale());
   CSSPoint point =
       APZCCallbackHelper::ApplyCallbackTransform(aPoint / scale, aGuid);
 
   switch (aType) {
     case GeckoContentController::TapType::eSingleTap:
       if (mBrowserChildMessageManager) {
-        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 1);
+        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 1);
       }
       break;
     case GeckoContentController::TapType::eDoubleTap:
       HandleDoubleTap(point, aModifiers, aGuid);
       break;
     case GeckoContentController::TapType::eSecondTap:
       if (mBrowserChildMessageManager) {
-        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 2);
+        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 2);
       }
       break;
     case GeckoContentController::TapType::eLongTap:
       if (mBrowserChildMessageManager) {
         RefPtr<APZEventState> eventState(mAPZEventState);
-        eventState->ProcessLongTap(presShell, point, scale, aModifiers, aGuid,
+        eventState->ProcessLongTap(presShell, point, scale, aModifiers,
                                    aInputBlockId);
       }
       break;
     case GeckoContentController::TapType::eLongTapUp:
       if (mBrowserChildMessageManager) {
         RefPtr<APZEventState> eventState(mAPZEventState);
         eventState->ProcessLongTapUp(presShell, point, scale, aModifiers);
       }
@@ -1642,17 +1639,17 @@ void BrowserChild::HandleRealMouseButton
 
   WidgetMouseEvent localEvent(aEvent);
   localEvent.mWidget = mPuppetWidget;
   APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
                                              mPuppetWidget->GetDefaultScale());
   DispatchWidgetEventViaAPZ(localEvent);
 
   if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
-    mAPZEventState->ProcessMouseEvent(aEvent, aGuid, aInputBlockId);
+    mAPZEventState->ProcessMouseEvent(aEvent, aInputBlockId);
   }
 
   // Do this after the DispatchWidgetEventViaAPZ call above, so that if the
   // mouse event triggered a post-refresh AsyncDragMetrics message to be sent
   // to APZ (from scrollbar dragging in nsSliderFrame), then that will reach
   // APZ before the SetTargetAPZC message. This ensures the drag input block
   // gets the drag metrics before handling the input events.
   if (postLayerization && postLayerization->Register()) {
@@ -1738,17 +1735,17 @@ void BrowserChild::DispatchWheelEvent(co
                                              mPuppetWidget->GetDefaultScale());
   DispatchWidgetEventViaAPZ(localEvent);
 
   if (localEvent.mCanTriggerSwipe) {
     SendRespondStartSwipeEvent(aInputBlockId, localEvent.TriggersSwipe());
   }
 
   if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
-    mAPZEventState->ProcessWheelEvent(localEvent, aGuid, aInputBlockId);
+    mAPZEventState->ProcessWheelEvent(localEvent, aInputBlockId);
   }
 }
 
 mozilla::ipc::IPCResult BrowserChild::RecvMouseWheelEvent(
     const WidgetWheelEvent& aEvent, const ScrollableLayerGuid& aGuid,
     const uint64_t& aInputBlockId) {
   bool isNextWheelEvent = false;
   if (MaybeCoalesceWheelEvent(aEvent, aGuid, aInputBlockId,
--- a/dom/ipc/BrowserChild.h
+++ b/dom/ipc/BrowserChild.h
@@ -581,18 +581,17 @@ class BrowserChild final : public Browse
   const mozilla::layers::CompositorOptions& GetCompositorOptions() const;
   bool AsyncPanZoomEnabled() const;
 
   virtual ScreenIntSize GetInnerSize() override;
 
   // Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
   void DoFakeShow(const ShowInfo& aShowInfo);
 
-  void ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
-                                 uint64_t aInputBlockId,
+  void ContentReceivedInputBlock(uint64_t aInputBlockId,
                                  bool aPreventDefault) const;
   void SetTargetAPZC(
       uint64_t aInputBlockId,
       const nsTArray<layers::SLGuidAndRenderRoot>& aTargets) const;
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   mozilla::ipc::IPCResult RecvHandleTap(
       const layers::GeckoContentController::TapType& aType,
       const LayoutDevicePoint& aPoint, const Modifiers& aModifiers,
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -170,21 +170,19 @@ class DelayedFireSingleTapEvent final : 
   RefPtr<nsIContent> mTouchRollup;
 };
 
 NS_IMPL_ISUPPORTS(DelayedFireSingleTapEvent, nsITimerCallback, nsINamed)
 
 void APZEventState::ProcessSingleTap(const CSSPoint& aPoint,
                                      const CSSToLayoutDeviceScale& aScale,
                                      Modifiers aModifiers,
-                                     const ScrollableLayerGuid& aGuid,
                                      int32_t aClickCount) {
-  APZES_LOG("Handling single tap at %s on %s with %d\n",
-            Stringify(aPoint).c_str(), Stringify(aGuid).c_str(),
-            mTouchEndCancelled);
+  APZES_LOG("Handling single tap at %s with %d\n",
+            Stringify(aPoint).c_str(), mTouchEndCancelled);
 
   RefPtr<nsIContent> touchRollup = GetTouchRollup();
   mTouchRollup = nullptr;
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return;
   }
@@ -258,17 +256,16 @@ bool APZEventState::FireContextmenuEvent
 
   return eventHandled;
 }
 
 void APZEventState::ProcessLongTap(PresShell* aPresShell,
                                    const CSSPoint& aPoint,
                                    const CSSToLayoutDeviceScale& aScale,
                                    Modifiers aModifiers,
-                                   const ScrollableLayerGuid& aGuid,
                                    uint64_t aInputBlockId) {
   APZES_LOG("Handling long tap at %s\n", Stringify(aPoint).c_str());
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return;
   }
 
@@ -284,17 +281,17 @@ void APZEventState::ProcessLongTap(PresS
       eMouseLongTap, /*time*/ 0, aPoint * aScale, aModifiers, /*clickCount*/ 1,
       widget);
 
   bool eventHandled = (status == nsEventStatus_eConsumeNoDefault);
 #else
   bool eventHandled =
       FireContextmenuEvents(aPresShell, aPoint, aScale, aModifiers, widget);
 #endif
-  mContentReceivedInputBlockCallback(aGuid, aInputBlockId, eventHandled);
+  mContentReceivedInputBlockCallback(aInputBlockId, eventHandled);
 
   if (eventHandled) {
     // Also send a touchcancel to content, so that listeners that might be
     // waiting for a touchend don't trigger.
     WidgetTouchEvent cancelTouchEvent(true, eTouchCancel, widget.get());
     cancelTouchEvent.mModifiers = aModifiers;
     auto ldPoint = LayoutDeviceIntPoint::Round(aPoint * aScale);
     cancelTouchEvent.mTouches.AppendElement(new mozilla::dom::Touch(
@@ -353,18 +350,17 @@ void APZEventState::ProcessTouchEvent(co
               "Propagating prevent-default from first-touch for block %" PRIu64
               "\n",
               aInputBlockId);
         }
         isTouchPrevented |= mFirstTouchCancelled;
       }
 
       if (isTouchPrevented) {
-        mContentReceivedInputBlockCallback(aGuid, aInputBlockId,
-                                           isTouchPrevented);
+        mContentReceivedInputBlockCallback(aInputBlockId, isTouchPrevented);
         sentContentResponse = true;
       } else {
         APZES_LOG("Event not prevented; pending response for %" PRIu64 " %s\n",
                   aInputBlockId, Stringify(aGuid).c_str());
         mPendingTouchPreventedResponse = true;
         mPendingTouchPreventedGuid = aGuid;
         mPendingTouchPreventedBlockId = aInputBlockId;
       }
@@ -410,29 +406,27 @@ void APZEventState::ProcessTouchEvent(co
       }
     }
     nsEventStatus status;
     cancelEvent.mWidget->DispatchEvent(&cancelEvent, status);
   }
 }
 
 void APZEventState::ProcessWheelEvent(const WidgetWheelEvent& aEvent,
-                                      const ScrollableLayerGuid& aGuid,
                                       uint64_t aInputBlockId) {
   // If this event starts a swipe, indicate that it shouldn't result in a
   // scroll by setting defaultPrevented to true.
   bool defaultPrevented = aEvent.DefaultPrevented() || aEvent.TriggersSwipe();
-  mContentReceivedInputBlockCallback(aGuid, aInputBlockId, defaultPrevented);
+  mContentReceivedInputBlockCallback(aInputBlockId, defaultPrevented);
 }
 
 void APZEventState::ProcessMouseEvent(const WidgetMouseEvent& aEvent,
-                                      const ScrollableLayerGuid& aGuid,
                                       uint64_t aInputBlockId) {
   bool defaultPrevented = false;
-  mContentReceivedInputBlockCallback(aGuid, aInputBlockId, defaultPrevented);
+  mContentReceivedInputBlockCallback(aInputBlockId, defaultPrevented);
 }
 
 void APZEventState::ProcessAPZStateChange(ViewID aViewId,
                                           APZStateChange aChange, int aArg) {
   switch (aChange) {
     case APZStateChange::eTransformBegin: {
       nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aViewId);
       if (sf) {
@@ -496,18 +490,17 @@ void APZEventState::ProcessClusterHit() 
 #endif
   mActiveElementManager->ClearActivation();
 }
 
 bool APZEventState::SendPendingTouchPreventedResponse(bool aPreventDefault) {
   if (mPendingTouchPreventedResponse) {
     APZES_LOG("Sending response %d for pending guid: %s\n", aPreventDefault,
               Stringify(mPendingTouchPreventedGuid).c_str());
-    mContentReceivedInputBlockCallback(mPendingTouchPreventedGuid,
-                                       mPendingTouchPreventedBlockId,
+    mContentReceivedInputBlockCallback(mPendingTouchPreventedBlockId,
                                        aPreventDefault);
     mPendingTouchPreventedResponse = false;
     return true;
   }
   return false;
 }
 
 already_AddRefed<nsIWidget> APZEventState::GetWidget() const {
--- a/gfx/layers/apz/util/APZEventState.h
+++ b/gfx/layers/apz/util/APZEventState.h
@@ -29,18 +29,17 @@ class nsIWidget;
 namespace mozilla {
 
 class PresShell;
 
 namespace layers {
 
 class ActiveElementManager;
 
-typedef std::function<void(const ScrollableLayerGuid&,
-                           uint64_t /* input block id */,
+typedef std::function<void(uint64_t /* input block id */,
                            bool /* prevent default */)>
     ContentReceivedInputBlockCallback;
 
 /**
  * A content-side component that keeps track of state for handling APZ
  * gestures and sending APZ notifications.
  */
 class APZEventState final {
@@ -50,36 +49,32 @@ class APZEventState final {
  public:
   APZEventState(nsIWidget* aWidget,
                 ContentReceivedInputBlockCallback&& aCallback);
 
   NS_INLINE_DECL_REFCOUNTING(APZEventState);
 
   void ProcessSingleTap(const CSSPoint& aPoint,
                         const CSSToLayoutDeviceScale& aScale,
-                        Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
-                        int32_t aClickCount);
+                        Modifiers aModifiers, int32_t aClickCount);
   MOZ_CAN_RUN_SCRIPT
   void ProcessLongTap(PresShell* aPresShell, const CSSPoint& aPoint,
                       const CSSToLayoutDeviceScale& aScale,
-                      Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
-                      uint64_t aInputBlockId);
+                      Modifiers aModifiers, uint64_t aInputBlockId);
   MOZ_CAN_RUN_SCRIPT
   void ProcessLongTapUp(PresShell* aPresShell, const CSSPoint& aPoint,
                         const CSSToLayoutDeviceScale& aScale,
                         Modifiers aModifiers);
   void ProcessTouchEvent(const WidgetTouchEvent& aEvent,
                          const ScrollableLayerGuid& aGuid,
                          uint64_t aInputBlockId, nsEventStatus aApzResponse,
                          nsEventStatus aContentResponse);
   void ProcessWheelEvent(const WidgetWheelEvent& aEvent,
-                         const ScrollableLayerGuid& aGuid,
                          uint64_t aInputBlockId);
   void ProcessMouseEvent(const WidgetMouseEvent& aEvent,
-                         const ScrollableLayerGuid& aGuid,
                          uint64_t aInputBlockId);
   void ProcessAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg);
   void ProcessClusterHit();
 
  private:
   ~APZEventState();
   bool SendPendingTouchPreventedResponse(bool aPreventDefault);
   MOZ_CAN_RUN_SCRIPT
--- a/gfx/layers/apz/util/ChromeProcessController.cpp
+++ b/gfx/layers/apz/util/ChromeProcessController.cpp
@@ -187,27 +187,27 @@ void ChromeProcessController::HandleTap(
   }
   CSSToLayoutDeviceScale scale(
       presShell->GetPresContext()->CSSToDevPixelScale());
   CSSPoint point =
       APZCCallbackHelper::ApplyCallbackTransform(aPoint / scale, aGuid);
 
   switch (aType) {
     case TapType::eSingleTap:
-      mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 1);
+      mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 1);
       break;
     case TapType::eDoubleTap:
       HandleDoubleTap(point, aModifiers, aGuid);
       break;
     case TapType::eSecondTap:
-      mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 2);
+      mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 2);
       break;
     case TapType::eLongTap: {
       RefPtr<APZEventState> eventState(mAPZEventState);
-      eventState->ProcessLongTap(presShell, point, scale, aModifiers, aGuid,
+      eventState->ProcessLongTap(presShell, point, scale, aModifiers,
                                  aInputBlockId);
       break;
     }
     case TapType::eLongTapUp: {
       RefPtr<APZEventState> eventState(mAPZEventState);
       eventState->ProcessLongTapUp(presShell, point, scale, aModifiers);
       break;
     }
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -863,18 +863,17 @@ void nsBaseWidget::ConfigureAPZCTreeMana
     APZThreadUtils::RunOnControllerThread(NewRunnableMethod<KeyboardMap>(
         "layers::IAPZCTreeManager::SetKeyboardMap", mAPZC,
         &IAPZCTreeManager::SetKeyboardMap, map));
   }
 
   RefPtr<IAPZCTreeManager> treeManager = mAPZC;  // for capture by the lambdas
 
   ContentReceivedInputBlockCallback callback(
-      [treeManager](const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId,
-                    bool aPreventDefault) {
+      [treeManager](uint64_t aInputBlockId, bool aPreventDefault) {
         MOZ_ASSERT(NS_IsMainThread());
         APZThreadUtils::RunOnControllerThread(NewRunnableMethod<uint64_t, bool>(
             "layers::IAPZCTreeManager::ContentReceivedInputBlock", treeManager,
             &IAPZCTreeManager::ContentReceivedInputBlock, aInputBlockId,
             aPreventDefault));
       });
   mAPZEventState = new APZEventState(this, std::move(callback));
 
@@ -991,23 +990,23 @@ nsEventStatus nsBaseWidget::ProcessUntra
     } else if (WidgetWheelEvent* wheelEvent = aEvent->AsWheelEvent()) {
       MOZ_ASSERT(wheelEvent->mFlags.mHandledByAPZ);
       postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
           this, GetDocument(), *(original->AsWheelEvent()), aGuid.mLayersId,
           aInputBlockId);
       if (wheelEvent->mCanTriggerSwipe) {
         ReportSwipeStarted(aInputBlockId, wheelEvent->TriggersSwipe());
       }
-      mAPZEventState->ProcessWheelEvent(*wheelEvent, aGuid, aInputBlockId);
+      mAPZEventState->ProcessWheelEvent(*wheelEvent, aInputBlockId);
     } else if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
       MOZ_ASSERT(mouseEvent->mFlags.mHandledByAPZ);
       postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
           this, GetDocument(), *(original->AsMouseEvent()), aGuid.mLayersId,
           aInputBlockId);
-      mAPZEventState->ProcessMouseEvent(*mouseEvent, aGuid, aInputBlockId);
+      mAPZEventState->ProcessMouseEvent(*mouseEvent, aInputBlockId);
     }
     if (postLayerization && postLayerization->Register()) {
       Unused << postLayerization.release();
     }
   }
 
   return status;
 }