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
Родитель b94945fed2
Коммит 69ed33396c
2 изменённых файлов: 5 добавлений и 12 удалений

Просмотреть файл

@ -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()

Просмотреть файл

@ -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