зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1494978
- Use LookupOrAdd to simplify hashtable lookup in mouse event coalescence; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D7179 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ee4552163c
Коммит
1b2661ee75
|
@ -1618,12 +1618,8 @@ TabChild::RecvRealMouseMoveEvent(const WidgetMouseEvent& aEvent,
|
|||
const uint64_t& aInputBlockId)
|
||||
{
|
||||
if (mCoalesceMouseMoveEvents && mCoalescedMouseEventFlusher) {
|
||||
CoalescedMouseData* data = nullptr;
|
||||
mCoalescedMouseData.Get(aEvent.pointerId, &data);
|
||||
if (!data) {
|
||||
data = new CoalescedMouseData();
|
||||
mCoalescedMouseData.Put(aEvent.pointerId, data);
|
||||
}
|
||||
CoalescedMouseData* data = mCoalescedMouseData.LookupOrAdd(aEvent.pointerId);
|
||||
MOZ_ASSERT(data);
|
||||
if (data->CanCoalesce(aEvent, aGuid, aInputBlockId)) {
|
||||
data->Coalesce(aEvent, aGuid, aInputBlockId);
|
||||
mCoalescedMouseEventFlusher->StartObserver();
|
||||
|
@ -1632,7 +1628,6 @@ TabChild::RecvRealMouseMoveEvent(const WidgetMouseEvent& aEvent,
|
|||
// Can't coalesce current mousemove event. Put the coalesced mousemove data
|
||||
// with the same pointer id to mToBeDispatchedMouseData, coalesce the
|
||||
// current one, and process all pending data in mToBeDispatchedMouseData.
|
||||
MOZ_ASSERT(data);
|
||||
UniquePtr<CoalescedMouseData> dispatchData =
|
||||
MakeUnique<CoalescedMouseData>();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче