forked from mirrors/gecko-dev
Rather than using a separate function APZCTreeManager::AddInputBlockCallback(), allow an optional callback argument to be passed to APZInputBridge::ReceiveInputEvent(). This avoids a race condition where the input block is processed before the callback has a chance to be added to the input queue, meaning the callback will never be fired. With the GPU process enabled the added latency of adding the callback cross-process meant this occured frequently, causing intermittent junit test failures. This works similarily to before, with the in-process APZCTreeManager implementation simply calling InputQueue::AddInputBlockCallback() and the InputQueue will fire the callback when the input block has been processed. For the cross-process implementation, APZInputBridgeChild maintains a local map of the callbacks, and APZInputBridgeParent adds an intermediate callback to its local InputQueue. This intermediate callback will call APZInputBridgeParent::SendCallInputBlockCallback(), which tells the APZInputBridgeChild to fire the real callback. Care must be taken in both APZInputBridgeChild and Parent to only add their respective callbacks if we determine that it is required, eg not already handled by the root APZ. Differential Revision: https://phabricator.services.mozilla.com/D138801
75 lines
2.9 KiB
C++
75 lines
2.9 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef mozilla_layers_APZInputBridgeParent_h
|
|
#define mozilla_layers_APZInputBridgeParent_h
|
|
|
|
#include "mozilla/layers/PAPZInputBridgeParent.h"
|
|
|
|
namespace mozilla {
|
|
namespace layers {
|
|
|
|
class IAPZCTreeManager;
|
|
|
|
class APZInputBridgeParent : public PAPZInputBridgeParent {
|
|
NS_INLINE_DECL_REFCOUNTING(APZInputBridgeParent, final)
|
|
|
|
public:
|
|
static RefPtr<APZInputBridgeParent> Create(
|
|
const LayersId& aLayersId, Endpoint<PAPZInputBridgeParent>&& aEndpoint);
|
|
|
|
mozilla::ipc::IPCResult RecvReceiveMultiTouchInputEvent(
|
|
const MultiTouchInput& aEvent, bool aWantsCallback,
|
|
APZEventResult* aOutResult, MultiTouchInput* aOutEvent);
|
|
|
|
mozilla::ipc::IPCResult RecvReceiveMouseInputEvent(const MouseInput& aEvent,
|
|
bool aWantsCallback,
|
|
APZEventResult* aOutResult,
|
|
MouseInput* aOutEvent);
|
|
|
|
mozilla::ipc::IPCResult RecvReceivePanGestureInputEvent(
|
|
const PanGestureInput& aEvent, bool aWantsCallback,
|
|
APZEventResult* aOutResult, PanGestureInput* aOutEvent);
|
|
|
|
mozilla::ipc::IPCResult RecvReceivePinchGestureInputEvent(
|
|
const PinchGestureInput& aEvent, bool aWantsCallback,
|
|
APZEventResult* aOutResult, PinchGestureInput* aOutEvent);
|
|
|
|
mozilla::ipc::IPCResult RecvReceiveTapGestureInputEvent(
|
|
const TapGestureInput& aEvent, bool aWantsCallback,
|
|
APZEventResult* aOutResult, TapGestureInput* aOutEvent);
|
|
|
|
mozilla::ipc::IPCResult RecvReceiveScrollWheelInputEvent(
|
|
const ScrollWheelInput& aEvent, bool aWantsCallback,
|
|
APZEventResult* aOutResult, ScrollWheelInput* aOutEvent);
|
|
|
|
mozilla::ipc::IPCResult RecvReceiveKeyboardInputEvent(
|
|
const KeyboardInput& aEvent, bool aWantsCallback,
|
|
APZEventResult* aOutResult, KeyboardInput* aOutEvent);
|
|
|
|
mozilla::ipc::IPCResult RecvUpdateWheelTransaction(
|
|
const LayoutDeviceIntPoint& aRefPoint, const EventMessage& aEventMessage,
|
|
const Maybe<ScrollableLayerGuid>& aTargetGuid);
|
|
|
|
mozilla::ipc::IPCResult RecvProcessUnhandledEvent(
|
|
const LayoutDeviceIntPoint& aRefPoint, LayoutDeviceIntPoint* aOutRefPoint,
|
|
ScrollableLayerGuid* aOutTargetGuid, uint64_t* aOutFocusSequenceNumber,
|
|
LayersId* aOutLayersId);
|
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
protected:
|
|
explicit APZInputBridgeParent(const LayersId& aLayersId);
|
|
virtual ~APZInputBridgeParent();
|
|
|
|
private:
|
|
RefPtr<IAPZCTreeManager> mTreeManager;
|
|
};
|
|
|
|
} // namespace layers
|
|
} // namespace mozilla
|
|
|
|
#endif // mozilla_layers_APZInputBridgeParent_h
|