зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1524226 - Add LayersId field to WidgetEvent and InputData. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D20169 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5349aa6e59
Коммит
862a7144a9
|
@ -9,6 +9,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
#include "mozilla/layers/LayersTypes.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
@ -478,7 +479,8 @@ class WidgetEvent : public WidgetEventTime {
|
|||
mLastRefPoint(0, 0),
|
||||
mFocusSequenceNumber(0),
|
||||
mSpecifiedEventType(nullptr),
|
||||
mPath(nullptr) {
|
||||
mPath(nullptr),
|
||||
mLayersId(layers::LayersId{0}) {
|
||||
MOZ_COUNT_CTOR(WidgetEvent);
|
||||
mFlags.Clear();
|
||||
mFlags.mIsTrusted = aIsTrusted;
|
||||
|
@ -570,6 +572,11 @@ class WidgetEvent : public WidgetEventTime {
|
|||
|
||||
nsTArray<EventTargetChainItem>* mPath;
|
||||
|
||||
// The LayersId of the content process that this event should be
|
||||
// dispatched to. This field is only used in the chrome process
|
||||
// and doesn't get remoted to child processes.
|
||||
layers::LayersId mLayersId;
|
||||
|
||||
dom::EventTarget* GetDOMEventTarget() const;
|
||||
dom::EventTarget* GetCurrentDOMEventTarget() const;
|
||||
dom::EventTarget* GetOriginalDOMEventTarget() const;
|
||||
|
@ -580,6 +587,7 @@ class WidgetEvent : public WidgetEventTime {
|
|||
mRefPoint = aEvent.mRefPoint;
|
||||
// mLastRefPoint doesn't need to be copied.
|
||||
mFocusSequenceNumber = aEvent.mFocusSequenceNumber;
|
||||
// mLayersId intentionally not copied, since it's not used within content
|
||||
AssignEventTime(aEvent);
|
||||
// mFlags should be copied manually if it's necessary.
|
||||
mSpecifiedEventType = aEvent.mSpecifiedEventType;
|
||||
|
|
|
@ -23,7 +23,11 @@ using namespace dom;
|
|||
InputData::~InputData() {}
|
||||
|
||||
InputData::InputData(InputType aInputType)
|
||||
: mInputType(aInputType), mTime(0), mFocusSequenceNumber(0), modifiers(0) {}
|
||||
: mInputType(aInputType),
|
||||
mTime(0),
|
||||
mFocusSequenceNumber(0),
|
||||
mLayersId{0},
|
||||
modifiers(0) {}
|
||||
|
||||
InputData::InputData(InputType aInputType, uint32_t aTime, TimeStamp aTimeStamp,
|
||||
Modifiers aModifiers)
|
||||
|
@ -31,6 +35,7 @@ InputData::InputData(InputType aInputType, uint32_t aTime, TimeStamp aTimeStamp,
|
|||
mTime(aTime),
|
||||
mTimeStamp(aTimeStamp),
|
||||
mFocusSequenceNumber(0),
|
||||
mLayersId{0},
|
||||
modifiers(aModifiers) {}
|
||||
|
||||
SingleTouchData::SingleTouchData(int32_t aIdentifier,
|
||||
|
|
|
@ -89,6 +89,10 @@ class InputData {
|
|||
// content, and focus can be reconfirmed for async keyboard scrolling.
|
||||
uint64_t mFocusSequenceNumber;
|
||||
|
||||
// The LayersId of the content process that the corresponding WidgetEvent
|
||||
// should be dispatched to.
|
||||
layers::LayersId mLayersId;
|
||||
|
||||
Modifiers modifiers;
|
||||
|
||||
INPUTDATA_AS_CHILD_TYPE(MultiTouchInput, MULTITOUCH_INPUT)
|
||||
|
|
|
@ -1092,6 +1092,7 @@ struct ParamTraits<mozilla::InputData> {
|
|||
WriteParam(aMsg, aParam.mTimeStamp);
|
||||
WriteParam(aMsg, aParam.modifiers);
|
||||
WriteParam(aMsg, aParam.mFocusSequenceNumber);
|
||||
WriteParam(aMsg, aParam.mLayersId);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
||||
|
@ -1100,7 +1101,8 @@ struct ParamTraits<mozilla::InputData> {
|
|||
ReadParam(aMsg, aIter, &aResult->mTime) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mTimeStamp) &&
|
||||
ReadParam(aMsg, aIter, &aResult->modifiers) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber);
|
||||
ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mLayersId);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче