Bug 1130051 - Compress mousemove IPDL messages. r=kats

Compress mousemove IPDL messages so that they do not spam the content
process.
This commit is contained in:
David Parks 2015-02-13 15:34:04 -08:00
parent fb471e3343
commit 51e2cb7da1
4 changed files with 19 additions and 4 deletions

View File

@ -517,7 +517,12 @@ child:
int32_t aModifiers,
bool aIgnoreRootScrollFrame);
RealMouseEvent(WidgetMouseEvent event);
/**
* When two consecutive mouse move events would be added to the message queue,
* they are 'compressed' by dumping the oldest one.
*/
RealMouseMoveEvent(WidgetMouseEvent event) compress;
RealMouseButtonEvent(WidgetMouseEvent event);
RealKeyEvent(WidgetKeyboardEvent event, MaybeNativeKeyBinding keyBinding);
MouseWheelEvent(WidgetWheelEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
RealTouchEvent(WidgetTouchEvent aEvent, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);

View File

@ -2159,7 +2159,13 @@ TabChild::RecvMouseEvent(const nsString& aType,
}
bool
TabChild::RecvRealMouseEvent(const WidgetMouseEvent& event)
TabChild::RecvRealMouseMoveEvent(const WidgetMouseEvent& event)
{
return RecvRealMouseButtonEvent(event);
}
bool
TabChild::RecvRealMouseButtonEvent(const WidgetMouseEvent& event)
{
WidgetMouseEvent localEvent(event);
localEvent.widget = mWidget;

View File

@ -354,7 +354,8 @@ public:
const int32_t& aClickCount,
const int32_t& aModifiers,
const bool& aIgnoreRootScrollFrame) MOZ_OVERRIDE;
virtual bool RecvRealMouseEvent(const mozilla::WidgetMouseEvent& event) MOZ_OVERRIDE;
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& event) MOZ_OVERRIDE;
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& event) MOZ_OVERRIDE;
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event,
const MaybeNativeKeyBinding& aBindings) MOZ_OVERRIDE;
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event,

View File

@ -1219,7 +1219,10 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
if (!MapEventCoordinatesForChildProcess(&event)) {
return false;
}
return PBrowserParent::SendRealMouseEvent(event);
if (event.message == NS_MOUSE_MOVE) {
return SendRealMouseMoveEvent(event);
}
return SendRealMouseButtonEvent(event);
}
CSSPoint TabParent::AdjustTapToChildWidget(const CSSPoint& aPoint)