Backed out 2 changesets (bug 1548568) for Valgrind failure. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Tue, 07 May 2019 01:13:06 +0300
changeset 472788 39077226dac335e743f7465fb91349d76ded1922
parent 472787 f776e9e5e817c9f1acd0451e915042089e80ce14
child 472789 406e4a9a3f758ae2c030b7b9437b8e0835876028
push id35978
push usershindli@mozilla.com
push dateTue, 07 May 2019 09:44:39 +0000
treeherdermozilla-central@7aee5a30dd15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1548568
milestone68.0a1
backs outb7d27dc874dfc46fcd4455bd4ad2ccddf3e5e754
dadb3b3dad5f2906d88dbf6661e1edb9514c0c91
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
Backed out 2 changesets (bug 1548568) for Valgrind failure. CLOSED TREE Backed out changeset b7d27dc874df (bug 1548568) Backed out changeset dadb3b3dad5f (bug 1548568)
dom/ipc/BrowserChild.cpp
dom/ipc/BrowserChild.h
gfx/layers/apz/util/APZCCallbackHelper.cpp
gfx/layers/apz/util/APZCCallbackHelper.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,17 +468,18 @@ BrowserChild::Observe(nsISupports* aSubj
         APZCCallbackHelper::InitializeRootDisplayport(presShell);
       }
     }
   }
 
   return NS_OK;
 }
 
-void BrowserChild::ContentReceivedInputBlock(uint64_t aInputBlockId,
+void BrowserChild::ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
+                                             uint64_t aInputBlockId,
                                              bool aPreventDefault) const {
   if (mApzcTreeManager) {
     mApzcTreeManager->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
   }
 }
 
 void BrowserChild::SetTargetAPZC(
     uint64_t aInputBlockId,
@@ -593,21 +594,23 @@ 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](uint64_t aInputBlockId, bool aPreventDefault) {
+      [weakPtrThis](const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId,
+                    bool aPreventDefault) {
         if (nsCOMPtr<nsIBrowserChild> browserChild =
                 do_QueryReferent(weakPtrThis)) {
           static_cast<BrowserChild*>(browserChild.get())
-              ->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
+              ->ContentReceivedInputBlock(aGuid, aInputBlockId,
+                                          aPreventDefault);
         }
       });
   mAPZEventState = new APZEventState(mPuppetWidget, std::move(callback));
 
   mIPCOpen = true;
 
   // Recording/replaying processes use their own compositor.
   if (recordreplay::IsRecordingOrReplaying()) {
@@ -1328,31 +1331,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, 1);
+        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 1);
       }
       break;
     case GeckoContentController::TapType::eDoubleTap:
       HandleDoubleTap(point, aModifiers, aGuid);
       break;
     case GeckoContentController::TapType::eSecondTap:
       if (mBrowserChildMessageManager) {
-        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 2);
+        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 2);
       }
       break;
     case GeckoContentController::TapType::eLongTap:
       if (mBrowserChildMessageManager) {
         RefPtr<APZEventState> eventState(mAPZEventState);
-        eventState->ProcessLongTap(presShell, point, scale, aModifiers,
+        eventState->ProcessLongTap(presShell, point, scale, aModifiers, aGuid,
                                    aInputBlockId);
       }
       break;
     case GeckoContentController::TapType::eLongTapUp:
       if (mBrowserChildMessageManager) {
         RefPtr<APZEventState> eventState(mAPZEventState);
         eventState->ProcessLongTapUp(presShell, point, scale, aModifiers);
       }
@@ -1626,30 +1629,30 @@ void BrowserChild::HandleRealMouseButton
   // the InputAPZContext in the parent process stack. However, they did not
   // actually go through the APZ code and so their mHandledByAPZ flag is false.
   // Since thos events didn't go through APZ, we don't need to send
   // notifications for them.
   UniquePtr<DisplayportSetListener> postLayerization;
   if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
     nsCOMPtr<Document> document(GetTopLevelDocument());
     postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
-        mPuppetWidget, document, aEvent, aGuid.mLayersId, aInputBlockId);
+        mPuppetWidget, document, aEvent, aGuid, aInputBlockId);
   }
 
   InputAPZContext context(aGuid, aInputBlockId, nsEventStatus_eIgnore,
                           postLayerization != nullptr);
 
   WidgetMouseEvent localEvent(aEvent);
   localEvent.mWidget = mPuppetWidget;
   APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
                                              mPuppetWidget->GetDefaultScale());
   DispatchWidgetEventViaAPZ(localEvent);
 
   if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
-    mAPZEventState->ProcessMouseEvent(aEvent, aInputBlockId);
+    mAPZEventState->ProcessMouseEvent(aEvent, aGuid, 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()) {
@@ -1719,33 +1722,33 @@ void BrowserChild::MaybeDispatchCoalesce
 void BrowserChild::DispatchWheelEvent(const WidgetWheelEvent& aEvent,
                                       const ScrollableLayerGuid& aGuid,
                                       const uint64_t& aInputBlockId) {
   WidgetWheelEvent localEvent(aEvent);
   if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
     nsCOMPtr<Document> document(GetTopLevelDocument());
     UniquePtr<DisplayportSetListener> postLayerization =
         APZCCallbackHelper::SendSetTargetAPZCNotification(
-            mPuppetWidget, document, aEvent, aGuid.mLayersId, aInputBlockId);
+            mPuppetWidget, document, aEvent, aGuid, aInputBlockId);
     if (postLayerization && postLayerization->Register()) {
       Unused << postLayerization.release();
     }
   }
 
   localEvent.mWidget = mPuppetWidget;
   APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
                                              mPuppetWidget->GetDefaultScale());
   DispatchWidgetEventViaAPZ(localEvent);
 
   if (localEvent.mCanTriggerSwipe) {
     SendRespondStartSwipeEvent(aInputBlockId, localEvent.TriggersSwipe());
   }
 
   if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
-    mAPZEventState->ProcessWheelEvent(localEvent, aInputBlockId);
+    mAPZEventState->ProcessWheelEvent(localEvent, aGuid, aInputBlockId);
   }
 }
 
 mozilla::ipc::IPCResult BrowserChild::RecvMouseWheelEvent(
     const WidgetWheelEvent& aEvent, const ScrollableLayerGuid& aGuid,
     const uint64_t& aInputBlockId) {
   bool isNextWheelEvent = false;
   if (MaybeCoalesceWheelEvent(aEvent, aGuid, aInputBlockId,
@@ -1792,17 +1795,17 @@ mozilla::ipc::IPCResult BrowserChild::Re
     nsCOMPtr<Document> document = GetTopLevelDocument();
     if (gfxPrefs::TouchActionEnabled()) {
       APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
           mPuppetWidget, document, localEvent, aInputBlockId,
           mSetAllowedTouchBehaviorCallback);
     }
     UniquePtr<DisplayportSetListener> postLayerization =
         APZCCallbackHelper::SendSetTargetAPZCNotification(
-            mPuppetWidget, document, localEvent, aGuid.mLayersId, aInputBlockId);
+            mPuppetWidget, document, localEvent, aGuid, aInputBlockId);
     if (postLayerization && postLayerization->Register()) {
       Unused << postLayerization.release();
     }
   }
 
   // Dispatch event to content (potentially a long-running operation)
   nsEventStatus status = DispatchWidgetEventViaAPZ(localEvent);
 
--- a/dom/ipc/BrowserChild.h
+++ b/dom/ipc/BrowserChild.h
@@ -581,17 +581,18 @@ 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(uint64_t aInputBlockId,
+  void ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
+                                 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/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -658,20 +658,20 @@ static nsIFrame* UpdateRootFrameForTouch
 namespace {
 
 using FrameForPointOption = nsLayoutUtils::FrameForPointOption;
 
 // Determine the scrollable target frame for the given point and add it to
 // the target list. If the frame doesn't have a displayport, set one.
 // Return whether or not a displayport was set.
 static bool PrepareForSetTargetAPZCNotification(
-    nsIWidget* aWidget, const LayersId& aLayersId, nsIFrame* aRootFrame,
+    nsIWidget* aWidget, const ScrollableLayerGuid& aGuid, nsIFrame* aRootFrame,
     const LayoutDeviceIntPoint& aRefPoint,
     nsTArray<SLGuidAndRenderRoot>* aTargets) {
-  SLGuidAndRenderRoot guid(aLayersId, 0,
+  SLGuidAndRenderRoot guid(aGuid.mLayersId, 0,
                            ScrollableLayerGuid::NULL_SCROLL_ID,
                            wr::RenderRoot::Default);
   nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
       aWidget, aRefPoint, aRootFrame);
   EnumSet<FrameForPointOption> options;
   if (nsLayoutUtils::AllowZoomingForDocument(
           aRootFrame->PresShell()->GetDocument())) {
     // If zooming is enabled, we need IgnoreRootScrollFrame for correct
@@ -815,17 +815,17 @@ void DisplayportSetListener::DidRefresh(
   }
 
   delete this;
 }
 
 UniquePtr<DisplayportSetListener>
 APZCCallbackHelper::SendSetTargetAPZCNotification(
     nsIWidget* aWidget, dom::Document* aDocument, const WidgetGUIEvent& aEvent,
-    const LayersId& aLayersId, uint64_t aInputBlockId) {
+    const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) {
   if (!aWidget || !aDocument) {
     return nullptr;
   }
   if (aInputBlockId == sLastTargetAPZCNotificationInputBlock) {
     // We have already confirmed the target APZC for a previous event of this
     // input block. If we activated a scroll frame for this input block,
     // sending another target APZC confirmation would be harmful, as it might
     // race the original confirmation (which needs to go through a layers
@@ -841,25 +841,25 @@ APZCCallbackHelper::SendSetTargetAPZCNot
       rootFrame = UpdateRootFrameForTouchTargetDocument(rootFrame);
 
       bool waitForRefresh = false;
       nsTArray<SLGuidAndRenderRoot> targets;
 
       if (const WidgetTouchEvent* touchEvent = aEvent.AsTouchEvent()) {
         for (size_t i = 0; i < touchEvent->mTouches.Length(); i++) {
           waitForRefresh |= PrepareForSetTargetAPZCNotification(
-              aWidget, aLayersId, rootFrame, touchEvent->mTouches[i]->mRefPoint,
+              aWidget, aGuid, rootFrame, touchEvent->mTouches[i]->mRefPoint,
               &targets);
         }
       } else if (const WidgetWheelEvent* wheelEvent = aEvent.AsWheelEvent()) {
         waitForRefresh = PrepareForSetTargetAPZCNotification(
-            aWidget, aLayersId, rootFrame, wheelEvent->mRefPoint, &targets);
+            aWidget, aGuid, rootFrame, wheelEvent->mRefPoint, &targets);
       } else if (const WidgetMouseEvent* mouseEvent = aEvent.AsMouseEvent()) {
         waitForRefresh = PrepareForSetTargetAPZCNotification(
-            aWidget, aLayersId, rootFrame, mouseEvent->mRefPoint, &targets);
+            aWidget, aGuid, rootFrame, mouseEvent->mRefPoint, &targets);
       }
       // TODO: Do other types of events need to be handled?
 
       if (!targets.IsEmpty()) {
         if (waitForRefresh) {
           APZCCH_LOG(
               "At least one target got a new displayport, need to wait for "
               "refresh\n");
--- a/gfx/layers/apz/util/APZCCallbackHelper.h
+++ b/gfx/layers/apz/util/APZCCallbackHelper.h
@@ -162,17 +162,17 @@ class APZCCallbackHelper {
    *
    * Having the caller manage this object is desirable in case they want to
    * (a) know about the fact that a displayport needs to be set, and
    * (b) register a post-refresh observer of their own that will run in
    *     a defined ordering relative to the APZ messages.
    */
   static UniquePtr<DisplayportSetListener> SendSetTargetAPZCNotification(
       nsIWidget* aWidget, mozilla::dom::Document* aDocument,
-      const WidgetGUIEvent& aEvent, const LayersId& aLayersId,
+      const WidgetGUIEvent& aEvent, const ScrollableLayerGuid& aGuid,
       uint64_t aInputBlockId);
 
   /* Figure out the allowed touch behaviors of each touch point in |aEvent|
    * and send that information to the provided callback. */
   static void SendSetAllowedTouchBehaviorNotification(
       nsIWidget* aWidget, mozilla::dom::Document* aDocument,
       const WidgetTouchEvent& aEvent, uint64_t aInputBlockId,
       const SetAllowedTouchBehaviorCallback& aCallback);
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -170,19 +170,21 @@ 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 with %d\n",
-            Stringify(aPoint).c_str(), mTouchEndCancelled);
+  APZES_LOG("Handling single tap at %s on %s with %d\n",
+            Stringify(aPoint).c_str(), Stringify(aGuid).c_str(),
+            mTouchEndCancelled);
 
   RefPtr<nsIContent> touchRollup = GetTouchRollup();
   mTouchRollup = nullptr;
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return;
   }
@@ -256,16 +258,17 @@ 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;
   }
 
@@ -281,17 +284,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(aInputBlockId, eventHandled);
+  mContentReceivedInputBlockCallback(aGuid, 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(
@@ -350,17 +353,18 @@ void APZEventState::ProcessTouchEvent(co
               "Propagating prevent-default from first-touch for block %" PRIu64
               "\n",
               aInputBlockId);
         }
         isTouchPrevented |= mFirstTouchCancelled;
       }
 
       if (isTouchPrevented) {
-        mContentReceivedInputBlockCallback(aInputBlockId, isTouchPrevented);
+        mContentReceivedInputBlockCallback(aGuid, 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;
       }
@@ -406,27 +410,29 @@ 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(aInputBlockId, defaultPrevented);
+  mContentReceivedInputBlockCallback(aGuid, aInputBlockId, defaultPrevented);
 }
 
 void APZEventState::ProcessMouseEvent(const WidgetMouseEvent& aEvent,
+                                      const ScrollableLayerGuid& aGuid,
                                       uint64_t aInputBlockId) {
   bool defaultPrevented = false;
-  mContentReceivedInputBlockCallback(aInputBlockId, defaultPrevented);
+  mContentReceivedInputBlockCallback(aGuid, aInputBlockId, defaultPrevented);
 }
 
 void APZEventState::ProcessAPZStateChange(ViewID aViewId,
                                           APZStateChange aChange, int aArg) {
   switch (aChange) {
     case APZStateChange::eTransformBegin: {
       nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aViewId);
       if (sf) {
@@ -490,17 +496,18 @@ 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(mPendingTouchPreventedBlockId,
+    mContentReceivedInputBlockCallback(mPendingTouchPreventedGuid,
+                                       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,17 +29,18 @@ class nsIWidget;
 namespace mozilla {
 
 class PresShell;
 
 namespace layers {
 
 class ActiveElementManager;
 
-typedef std::function<void(uint64_t /* input block id */,
+typedef std::function<void(const ScrollableLayerGuid&,
+                           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 {
@@ -49,32 +50,36 @@ class APZEventState final {
  public:
   APZEventState(nsIWidget* aWidget,
                 ContentReceivedInputBlockCallback&& aCallback);
 
   NS_INLINE_DECL_REFCOUNTING(APZEventState);
 
   void ProcessSingleTap(const CSSPoint& aPoint,
                         const CSSToLayoutDeviceScale& aScale,
-                        Modifiers aModifiers, int32_t aClickCount);
+                        Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
+                        int32_t aClickCount);
   MOZ_CAN_RUN_SCRIPT
   void ProcessLongTap(PresShell* aPresShell, const CSSPoint& aPoint,
                       const CSSToLayoutDeviceScale& aScale,
-                      Modifiers aModifiers, uint64_t aInputBlockId);
+                      Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
+                      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, 1);
+      mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 1);
       break;
     case TapType::eDoubleTap:
       HandleDoubleTap(point, aModifiers, aGuid);
       break;
     case TapType::eSecondTap:
-      mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 2);
+      mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid, 2);
       break;
     case TapType::eLongTap: {
       RefPtr<APZEventState> eventState(mAPZEventState);
-      eventState->ProcessLongTap(presShell, point, scale, aModifiers,
+      eventState->ProcessLongTap(presShell, point, scale, aModifiers, aGuid,
                                  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,17 +863,18 @@ 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](uint64_t aInputBlockId, bool aPreventDefault) {
+      [treeManager](const ScrollableLayerGuid& aGuid, 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));
 
@@ -977,36 +978,36 @@ nsEventStatus nsBaseWidget::ProcessUntra
     if (WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent()) {
       if (touchEvent->mMessage == eTouchStart) {
         if (gfxPrefs::TouchActionEnabled()) {
           APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
               this, GetDocument(), *(original->AsTouchEvent()), aInputBlockId,
               mSetAllowedTouchBehaviorCallback);
         }
         postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
-            this, GetDocument(), *(original->AsTouchEvent()), aGuid.mLayersId,
+            this, GetDocument(), *(original->AsTouchEvent()), aGuid,
             aInputBlockId);
       }
       mAPZEventState->ProcessTouchEvent(*touchEvent, aGuid, aInputBlockId,
                                         aApzResponse, status);
     } else if (WidgetWheelEvent* wheelEvent = aEvent->AsWheelEvent()) {
       MOZ_ASSERT(wheelEvent->mFlags.mHandledByAPZ);
       postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
-          this, GetDocument(), *(original->AsWheelEvent()), aGuid.mLayersId,
+          this, GetDocument(), *(original->AsWheelEvent()), aGuid,
           aInputBlockId);
       if (wheelEvent->mCanTriggerSwipe) {
         ReportSwipeStarted(aInputBlockId, wheelEvent->TriggersSwipe());
       }
-      mAPZEventState->ProcessWheelEvent(*wheelEvent, aInputBlockId);
+      mAPZEventState->ProcessWheelEvent(*wheelEvent, aGuid, aInputBlockId);
     } else if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
       MOZ_ASSERT(mouseEvent->mFlags.mHandledByAPZ);
       postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
-          this, GetDocument(), *(original->AsMouseEvent()), aGuid.mLayersId,
+          this, GetDocument(), *(original->AsMouseEvent()), aGuid,
           aInputBlockId);
-      mAPZEventState->ProcessMouseEvent(*mouseEvent, aInputBlockId);
+      mAPZEventState->ProcessMouseEvent(*mouseEvent, aGuid, aInputBlockId);
     }
     if (postLayerization && postLayerization->Register()) {
       Unused << postLayerization.release();
     }
   }
 
   return status;
 }