Bug 1407700 Part1: Revise CoalescedInputData interfaces. r=smaug.

MozReview-Commit-ID: 75AsFBM4qr
This commit is contained in:
Stone Shih 2017-10-12 11:22:36 +08:00
parent b94945fed2
commit 69ed33396c
2 changed files with 5 additions and 12 deletions

View File

@ -29,11 +29,6 @@ public:
{
}
void Reset()
{
mCoalescedInputEvent = nullptr;
}
bool IsEmpty()
{
return !mCoalescedInputEvent;
@ -43,9 +38,9 @@ public:
const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId);
const InputEventType* GetCoalescedEvent()
UniquePtr<InputEventType> TakeCoalescedEvent()
{
return mCoalescedInputEvent.get();
return Move(mCoalescedInputEvent);
}
ScrollableLayerGuid GetScrollableLayerGuid()

View File

@ -1601,14 +1601,13 @@ TabChild::MaybeDispatchCoalescedMouseMoveEvents()
if (!data || data->IsEmpty()) {
continue;
}
const WidgetMouseEvent* event = data->GetCoalescedEvent();
UniquePtr<WidgetMouseEvent> event = data->TakeCoalescedEvent();
MOZ_ASSERT(event);
// Dispatch the coalesced mousemove event. Using RecvRealMouseButtonEvent to
// bypass the coalesce handling in RecvRealMouseMoveEvent.
RecvRealMouseButtonEvent(*event,
data->GetScrollableLayerGuid(),
data->GetInputBlockId());
data->Reset();
}
if (mCoalescedMouseEventFlusher) {
mCoalescedMouseEventFlusher->RemoveObserver();
@ -1779,13 +1778,12 @@ TabChild::MaybeDispatchCoalescedWheelEvent()
if (mCoalescedWheelData.IsEmpty()) {
return;
}
const WidgetWheelEvent* wheelEvent =
mCoalescedWheelData.GetCoalescedEvent();
UniquePtr<WidgetWheelEvent> wheelEvent =
mCoalescedWheelData.TakeCoalescedEvent();
MOZ_ASSERT(wheelEvent);
DispatchWheelEvent(*wheelEvent,
mCoalescedWheelData.GetScrollableLayerGuid(),
mCoalescedWheelData.GetInputBlockId());
mCoalescedWheelData.Reset();
}
void