Bug 1533617 part 2. Improve MOZ_CAN_RUN_SCRIPT annotations around APZ tap events. r=kats

Differential Revision: https://phabricator.services.mozilla.com/D22836

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2019-03-11 14:18:51 +00:00
parent 6f2f3304b0
commit 5879288b7b
4 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@
#include "LayersTypes.h" // for ScrollDirection
#include "Units.h" // for CSSPoint, CSSRect, etc
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/Attributes.h" // for MOZ_CAN_RUN_SCRIPT
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
#include "mozilla/EventForwards.h" // for Modifiers
#include "mozilla/layers/MatrixMessage.h" // for MatrixMessage
@ -76,6 +77,7 @@ class GeckoContentController {
* Requests handling of a tap event. |aPoint| is in LD pixels, relative to the
* current scroll offset.
*/
MOZ_CAN_RUN_SCRIPT
virtual void HandleTap(TapType aType, const LayoutDevicePoint& aPoint,
Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId) = 0;

View File

@ -664,6 +664,7 @@ class AsyncPanZoomController {
/**
* Helper methods for long press gestures.
*/
MOZ_CAN_RUN_SCRIPT_BOUNDARY
nsEventStatus OnLongPress(const TapGestureInput& aEvent);
nsEventStatus OnLongPressUp(const TapGestureInput& aEvent);
@ -680,6 +681,7 @@ class AsyncPanZoomController {
/**
* Helper method for double taps.
*/
MOZ_CAN_RUN_SCRIPT_BOUNDARY
nsEventStatus OnDoubleTap(const TapGestureInput& aEvent);
/**

View File

@ -127,7 +127,9 @@ mozilla::ipc::IPCResult APZCTreeManagerChild::RecvHandleTap(
if (mCompositorSession &&
mCompositorSession->RootLayerTreeId() == aGuid.mLayersId &&
mCompositorSession->GetContentController()) {
mCompositorSession->GetContentController()->HandleTap(
RefPtr<GeckoContentController> controller =
mCompositorSession->GetContentController();
controller->HandleTap(
aType, aPoint, aModifiers, aGuid, aInputBlockId);
return IPC_OK();
}

View File

@ -66,6 +66,7 @@ class APZCTreeManagerChild : public IAPZCTreeManager,
void ActorDestroy(ActorDestroyReason aWhy) override;
protected:
MOZ_CAN_RUN_SCRIPT_BOUNDARY
mozilla::ipc::IPCResult RecvHandleTap(const TapType& aType,
const LayoutDevicePoint& aPoint,
const Modifiers& aModifiers,