Bug 1259655 - part 2 Rename WidgetEventTime::timeStamp to WidgetEventTime::mTimeStamp r=masayuki
authorArata Furukawa <old.river.new@gmail.com>
Mon, 28 Mar 2016 13:49:02 +0900
changeset 290649 720933fc00b99d6ec11d8be54b710cdf493f18eb
parent 290648 b7d97d1311d71903b6421c7083a3adbc1dabb511
child 290650 201cab594d2a38a457745ffd293994441e02113f
push id18399
push userkwierso@gmail.com
push dateMon, 28 Mar 2016 20:08:57 +0000
treeherderfx-team@f40c52c4b800 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1259655
milestone48.0a1
Bug 1259655 - part 2 Rename WidgetEventTime::timeStamp to WidgetEventTime::mTimeStamp r=masayuki MozReview-Commit-ID: LRgPxoynx0
dom/events/Event.cpp
dom/events/EventStateManager.cpp
dom/events/TextComposition.cpp
gfx/layers/apz/src/APZCTreeManager.cpp
layout/base/nsPresShell.cpp
widget/BasicEvents.h
widget/InputData.cpp
widget/TouchEvents.h
widget/cocoa/SwipeTracker.mm
widget/nsGUIEventIPC.h
widget/windows/nsWindow.cpp
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -1062,17 +1062,17 @@ Event::DefaultPrevented(JSContext* aCx) 
 
 double
 Event::TimeStamp() const
 {
   if (!sReturnHighResTimeStamp) {
     return static_cast<double>(mEvent->mTime);
   }
 
-  if (mEvent->timeStamp.IsNull()) {
+  if (mEvent->mTimeStamp.IsNull()) {
     return 0.0;
   }
 
   if (mIsMainThreadEvent) {
     if (NS_WARN_IF(!mOwner)) {
       return 0.0;
     }
 
@@ -1080,28 +1080,28 @@ Event::TimeStamp() const
     if (NS_WARN_IF(!win)) {
       return 0.0;
     }
     nsPerformance* perf = win->GetPerformance();
     if (NS_WARN_IF(!perf)) {
       return 0.0;
     }
 
-    return perf->GetDOMTiming()->TimeStampToDOMHighRes(mEvent->timeStamp);
+    return perf->GetDOMTiming()->TimeStampToDOMHighRes(mEvent->mTimeStamp);
   }
 
   // For dedicated workers, we should make times relative to the navigation
   // start of the document that created the worker, which is the same as the
   // timebase for performance.now().
   workers::WorkerPrivate* workerPrivate =
     workers::GetCurrentThreadWorkerPrivate();
   MOZ_ASSERT(workerPrivate);
 
   TimeDuration duration =
-    mEvent->timeStamp - workerPrivate->NowBaseTimeStamp();
+    mEvent->mTimeStamp - workerPrivate->NowBaseTimeStamp();
   return duration.ToMilliseconds();
 }
 
 bool
 Event::GetPreventDefault() const
 {
   nsCOMPtr<nsPIDOMWindowInner> win(do_QueryInterface(mOwner));
   if (win) {
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2295,17 +2295,17 @@ EventStateManager::SendLineScrollEvent(n
 
   WidgetMouseScrollEvent event(aEvent->IsTrusted(),
                                eLegacyMouseLineOrPageScroll, aEvent->widget);
   event.mFlags.mDefaultPrevented = aState.mDefaultPrevented;
   event.mFlags.mDefaultPreventedByContent = aState.mDefaultPreventedByContent;
   event.refPoint = aEvent->refPoint;
   event.widget = aEvent->widget;
   event.mTime = aEvent->mTime;
-  event.timeStamp = aEvent->timeStamp;
+  event.mTimeStamp = aEvent->mTimeStamp;
   event.modifiers = aEvent->modifiers;
   event.buttons = aEvent->buttons;
   event.isHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
   event.delta = aDelta;
   event.inputSource = aEvent->inputSource;
 
   nsEventStatus status = nsEventStatus_eIgnore;
   EventDispatcher::Dispatch(targetContent, aTargetFrame->PresContext(),
@@ -2335,17 +2335,17 @@ EventStateManager::SendPixelScrollEvent(
 
   WidgetMouseScrollEvent event(aEvent->IsTrusted(),
                                eLegacyMousePixelScroll, aEvent->widget);
   event.mFlags.mDefaultPrevented = aState.mDefaultPrevented;
   event.mFlags.mDefaultPreventedByContent = aState.mDefaultPreventedByContent;
   event.refPoint = aEvent->refPoint;
   event.widget = aEvent->widget;
   event.mTime = aEvent->mTime;
-  event.timeStamp = aEvent->timeStamp;
+  event.mTimeStamp = aEvent->mTimeStamp;
   event.modifiers = aEvent->modifiers;
   event.buttons = aEvent->buttons;
   event.isHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
   event.delta = aPixelDelta;
   event.inputSource = aEvent->inputSource;
 
   nsEventStatus status = nsEventStatus_eIgnore;
   EventDispatcher::Dispatch(targetContent, aTargetFrame->PresContext(),
@@ -4639,17 +4639,17 @@ EventStateManager::CheckForAndDispatchCl
 
     WidgetMouseEvent event(aEvent->IsTrusted(), eMouseClick,
                            aEvent->widget, WidgetMouseEvent::eReal);
     event.refPoint = aEvent->refPoint;
     event.clickCount = aEvent->clickCount;
     event.modifiers = aEvent->modifiers;
     event.buttons = aEvent->buttons;
     event.mTime = aEvent->mTime;
-    event.timeStamp = aEvent->timeStamp;
+    event.mTimeStamp = aEvent->mTimeStamp;
     event.mFlags.mNoContentDispatch = notDispatchToContents;
     event.button = aEvent->button;
     event.inputSource = aEvent->inputSource;
 
     nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
     if (presShell) {
       nsCOMPtr<nsIContent> mouseContent = GetEventTargetContent(aEvent);
       // Click events apply to *elements* not nodes. At this point the target
--- a/dom/events/TextComposition.cpp
+++ b/dom/events/TextComposition.cpp
@@ -116,17 +116,17 @@ TextComposition::CloneAndDispatchAs(
   MOZ_RELEASE_ASSERT(!mTabParent);
 
   MOZ_ASSERT(IsValidStateForComposition(aCompositionEvent->widget),
              "Should be called only when it's safe to dispatch an event");
 
   WidgetCompositionEvent compositionEvent(aCompositionEvent->IsTrusted(),
                                           aMessage, aCompositionEvent->widget);
   compositionEvent.mTime = aCompositionEvent->mTime;
-  compositionEvent.timeStamp = aCompositionEvent->timeStamp;
+  compositionEvent.mTimeStamp = aCompositionEvent->mTimeStamp;
   compositionEvent.mData = aCompositionEvent->mData;
   compositionEvent.mNativeIMEContext = aCompositionEvent->mNativeIMEContext;
   compositionEvent.mOriginalMessage = aCompositionEvent->mMessage;
   compositionEvent.mFlags.mIsSynthesizedForTests =
     aCompositionEvent->mFlags.mIsSynthesizedForTests;
 
   nsEventStatus dummyStatus = nsEventStatus_eConsumeNoDefault;
   nsEventStatus* status = aStatus ? aStatus : &dummyStatus;
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -1088,17 +1088,17 @@ APZCTreeManager::ProcessWheelEvent(Widge
         gfxPrefs::WheelSmoothScrollEnabled()) ||
        (aEvent.deltaMode == nsIDOMWheelEvent::DOM_DELTA_PAGE &&
         gfxPrefs::PageSmoothScrollEnabled())))
   {
     scrollMode = ScrollWheelInput::SCROLLMODE_SMOOTH;
   }
 
   ScreenPoint origin(aEvent.refPoint.x, aEvent.refPoint.y);
-  ScrollWheelInput input(aEvent.mTime, aEvent.timeStamp, 0,
+  ScrollWheelInput input(aEvent.mTime, aEvent.mTimeStamp, 0,
                          scrollMode,
                          ScrollWheelInput::DeltaTypeForDeltaMode(aEvent.deltaMode),
                          origin,
                          aEvent.deltaX, aEvent.deltaY,
                          aEvent.mAllowToOverrideSystemScrollSpeed);
 
   // We add the user multiplier as a separate field, rather than premultiplying
   // it, because if the input is converted back to a WidgetWheelEvent, then
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6880,17 +6880,17 @@ DispatchPointerFromMouseOrTouch(PresShel
       event.pointerId = touch->Identifier();
       event.refPoint = touch->mRefPoint;
       event.modifiers = touchEvent->modifiers;
       event.width = touch->RadiusX();
       event.height = touch->RadiusY();
       event.tiltX = touch->tiltX;
       event.tiltY = touch->tiltY;
       event.mTime = touchEvent->mTime;
-      event.timeStamp = touchEvent->timeStamp;
+      event.mTimeStamp = touchEvent->mTimeStamp;
       event.mFlags = touchEvent->mFlags;
       event.button = WidgetMouseEvent::eLeftButton;
       event.buttons = WidgetMouseEvent::eLeftButtonFlag;
       event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
       event.convertToPointer = touch->convertToPointer = false;
       aShell->HandleEvent(aFrame, &event, aDontRetargetEvents, aStatus, aTargetContent);
     }
   }
@@ -8139,19 +8139,19 @@ PresShell::HandleEventInternal(WidgetEve
       nsIPresShell::AllowMouseCapture(false);
       break;
     default:
       break;
     }
   }
 
   if (Telemetry::CanRecordBase() &&
-      !aEvent->timeStamp.IsNull() &&
+      !aEvent->mTimeStamp.IsNull() &&
       aEvent->AsInputEvent()) {
-    double millis = (TimeStamp::Now() - aEvent->timeStamp).ToMilliseconds();
+    double millis = (TimeStamp::Now() - aEvent->mTimeStamp).ToMilliseconds();
     Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_MS, millis);
   }
 
   return rv;
 }
 
 void
 nsIPresShell::DispatchGotOrLostPointerCaptureEvent(bool aIsGotCapture,
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -231,35 +231,35 @@ struct EventFlags : public BaseEventFlag
 class WidgetEventTime
 {
 public:
   // Elapsed time, in milliseconds, from a platform-specific zero time
   // to the time the message was created
   uint64_t mTime;
   // Timestamp when the message was created. Set in parallel to 'time' until we
   // determine if it is safe to drop 'time' (see bug 77992).
-  TimeStamp timeStamp;
+  TimeStamp mTimeStamp;
 
   WidgetEventTime()
     : mTime(0)
-    , timeStamp(TimeStamp::Now())
+    , mTimeStamp(TimeStamp::Now())
   {
   }
 
   WidgetEventTime(uint64_t aTime,
                   TimeStamp aTimeStamp)
     : mTime(aTime)
-    , timeStamp(aTimeStamp)
+    , mTimeStamp(aTimeStamp)
   {
   }
 
   void AssignEventTime(const WidgetEventTime& aOther)
   {
     mTime = aOther.mTime;
-    timeStamp = aOther.timeStamp;
+    mTimeStamp = aOther.mTimeStamp;
   }
 };
 
 /******************************************************************************
  * mozilla::WidgetEvent
  ******************************************************************************/
 
 class WidgetEvent : public WidgetEventTime
--- a/widget/InputData.cpp
+++ b/widget/InputData.cpp
@@ -24,17 +24,17 @@ already_AddRefed<Touch> SingleTouchData:
                                   LayoutDeviceIntPoint(mScreenPoint.x, mScreenPoint.y),
                                   LayoutDeviceIntPoint(mRadius.width, mRadius.height),
                                   mRotationAngle,
                                   mForce);
   return touch.forget();
 }
 
 MouseInput::MouseInput(const WidgetMouseEventBase& aMouseEvent)
-  : InputData(MOUSE_INPUT, aMouseEvent.mTime, aMouseEvent.timeStamp,
+  : InputData(MOUSE_INPUT, aMouseEvent.mTime, aMouseEvent.mTimeStamp,
               aMouseEvent.modifiers)
   , mType(MOUSE_NONE)
   , mButtonType(NONE)
   , mButtons(aMouseEvent.buttons)
 {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only copy from WidgetTouchEvent on main thread");
 
@@ -152,29 +152,29 @@ MouseInput::ToWidgetMouseEvent(nsIWidget
     case MouseInput::NONE:
     default:
       break;
   }
 
   event.buttons = mButtons;
   event.modifiers = modifiers;
   event.mTime = mTime;
-  event.timeStamp = mTimeStamp;
+  event.mTimeStamp = mTimeStamp;
   event.refPoint =
     RoundedToInt(ViewAs<LayoutDevicePixel>(mOrigin,
       PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
   event.clickCount = clickCount;
   event.inputSource = mInputSource;
   event.ignoreRootScrollFrame = true;
 
   return event;
 }
 
 MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent)
-  : InputData(MULTITOUCH_INPUT, aTouchEvent.mTime, aTouchEvent.timeStamp,
+  : InputData(MULTITOUCH_INPUT, aTouchEvent.mTime, aTouchEvent.mTimeStamp,
               aTouchEvent.modifiers)
   , mHandledByAPZ(aTouchEvent.mFlags.mHandledByAPZ)
 {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only copy from WidgetTouchEvent on main thread");
 
   switch (aTouchEvent.mMessage) {
     case eTouchStart:
@@ -242,17 +242,17 @@ MultiTouchInput::ToWidgetTouchEvent(nsIW
 
   WidgetTouchEvent event(true, touchEventMessage, aWidget);
   if (touchEventMessage == eVoidEvent) {
     return event;
   }
 
   event.modifiers = this->modifiers;
   event.mTime = this->mTime;
-  event.timeStamp = this->mTimeStamp;
+  event.mTimeStamp = this->mTimeStamp;
   event.mFlags.mHandledByAPZ = mHandledByAPZ;
 
   for (size_t i = 0; i < mTouches.Length(); i++) {
     *event.touches.AppendElement() = mTouches[i].ToNewDOMTouch();
   }
 
   return event;
 }
@@ -313,17 +313,17 @@ MultiTouchInput::IndexOfTouch(int32_t aT
 
 // This conversion from WidgetMouseEvent to MultiTouchInput is needed because on
 // the B2G emulator we can only receive mouse events, but we need to be able
 // to pan correctly. To do this, we convert the events into a format that the
 // panning code can handle. This code is very limited and only supports
 // SingleTouchData. It also sends garbage for the identifier, radius, force
 // and rotation angle.
 MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
-  : InputData(MULTITOUCH_INPUT, aMouseEvent.mTime, aMouseEvent.timeStamp,
+  : InputData(MULTITOUCH_INPUT, aMouseEvent.mTime, aMouseEvent.mTimeStamp,
               aMouseEvent.modifiers)
   , mHandledByAPZ(aMouseEvent.mFlags.mHandledByAPZ)
 {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only copy from WidgetMouseEvent on main thread");
   switch (aMouseEvent.mMessage) {
   case eMouseDown:
     mType = MULTITOUCH_START;
@@ -381,17 +381,17 @@ PanGestureInput::IsMomentum() const
 }
 
 WidgetWheelEvent
 PanGestureInput::ToWidgetWheelEvent(nsIWidget* aWidget) const
 {
   WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
   wheelEvent.modifiers = this->modifiers;
   wheelEvent.mTime = mTime;
-  wheelEvent.timeStamp = mTimeStamp;
+  wheelEvent.mTimeStamp = mTimeStamp;
   wheelEvent.refPoint =
     RoundedToInt(ViewAs<LayoutDevicePixel>(mPanStartPoint,
       PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
   wheelEvent.buttons = 0;
   wheelEvent.deltaMode = nsIDOMWheelEvent::DOM_DELTA_PIXEL;
   wheelEvent.mayHaveMomentum = true; // pan inputs may have momentum
   wheelEvent.isMomentum = IsMomentum();
   wheelEvent.lineOrPageDeltaX = mLineOrPageDeltaX;
@@ -453,17 +453,17 @@ DeltaModeForDeltaType(ScrollWheelInput::
     default:
       return nsIDOMWheelEvent::DOM_DELTA_PIXEL;
   }
 }
 
 ScrollWheelInput::ScrollWheelInput(const WidgetWheelEvent& aWheelEvent)
   : InputData(SCROLLWHEEL_INPUT,
               aWheelEvent.mTime,
-              aWheelEvent.timeStamp,
+              aWheelEvent.mTimeStamp,
               aWheelEvent.modifiers)
   , mDeltaType(DeltaTypeForDeltaMode(aWheelEvent.deltaMode))
   , mScrollMode(SCROLLMODE_INSTANT)
   , mHandledByAPZ(aWheelEvent.mFlags.mHandledByAPZ)
   , mDeltaX(aWheelEvent.deltaX)
   , mDeltaY(aWheelEvent.deltaY)
   , mLineOrPageDeltaX(aWheelEvent.lineOrPageDeltaX)
   , mLineOrPageDeltaY(aWheelEvent.lineOrPageDeltaY)
@@ -481,17 +481,17 @@ ScrollWheelInput::ScrollWheelInput(const
 }
 
 WidgetWheelEvent
 ScrollWheelInput::ToWidgetWheelEvent(nsIWidget* aWidget) const
 {
   WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
   wheelEvent.modifiers = this->modifiers;
   wheelEvent.mTime = mTime;
-  wheelEvent.timeStamp = mTimeStamp;
+  wheelEvent.mTimeStamp = mTimeStamp;
   wheelEvent.refPoint =
     RoundedToInt(ViewAs<LayoutDevicePixel>(mOrigin,
       PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
   wheelEvent.buttons = 0;
   wheelEvent.deltaMode = DeltaModeForDeltaType(mDeltaType);
   wheelEvent.mayHaveMomentum = mMayHaveMomentum;
   wheelEvent.isMomentum = mIsMomentum;
   wheelEvent.deltaX = mDeltaX;
--- a/widget/TouchEvents.h
+++ b/widget/TouchEvents.h
@@ -168,17 +168,17 @@ public:
 
   WidgetTouchEvent(const WidgetTouchEvent& aOther)
     : WidgetInputEvent(aOther.IsTrusted(), aOther.mMessage, aOther.widget,
                        eTouchEventClass)
   {
     MOZ_COUNT_CTOR(WidgetTouchEvent);
     modifiers = aOther.modifiers;
     mTime = aOther.mTime;
-    timeStamp = aOther.timeStamp;
+    mTimeStamp = aOther.mTimeStamp;
     touches.AppendElements(aOther.touches);
     mFlags.mCancelable = mMessage != eTouchCancel;
     mFlags.mHandledByAPZ = aOther.mFlags.mHandledByAPZ;
   }
 
   WidgetTouchEvent(bool aIsTrusted, EventMessage aMessage, nsIWidget* aWidget)
     : WidgetInputEvent(aIsTrusted, aMessage, aWidget, eTouchEventClass)
   {
--- a/widget/cocoa/SwipeTracker.mm
+++ b/widget/cocoa/SwipeTracker.mm
@@ -195,17 +195,17 @@ SwipeTracker::UnregisterFromRefreshDrive
 }
 
 /* static */ WidgetSimpleGestureEvent
 SwipeTracker::CreateSwipeGestureEvent(EventMessage aMsg, nsIWidget* aWidget,
                                       const LayoutDeviceIntPoint& aPosition)
 {
   WidgetSimpleGestureEvent geckoEvent(true, aMsg, aWidget);
   geckoEvent.modifiers = 0;
-  geckoEvent.timeStamp = TimeStamp::Now();
+  geckoEvent.mTimeStamp = TimeStamp::Now();
   geckoEvent.refPoint = aPosition;
   geckoEvent.buttons = 0;
   return geckoEvent;
 }
 
 bool
 SwipeTracker::SendSwipeEvent(EventMessage aMsg, uint32_t aDirection, double aDelta)
 {
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -65,28 +65,28 @@ struct ParamTraits<mozilla::WidgetEvent>
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg,
       static_cast<mozilla::EventClassIDType>(aParam.mClass));
     WriteParam(aMsg, aParam.mMessage);
     WriteParam(aMsg, aParam.refPoint);
     WriteParam(aMsg, aParam.mTime);
-    WriteParam(aMsg, aParam.timeStamp);
+    WriteParam(aMsg, aParam.mTimeStamp);
     WriteParam(aMsg, aParam.mFlags);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     mozilla::EventClassIDType eventClassID = 0;
     bool ret = ReadParam(aMsg, aIter, &eventClassID) &&
                ReadParam(aMsg, aIter, &aResult->mMessage) &&
                ReadParam(aMsg, aIter, &aResult->refPoint) &&
                ReadParam(aMsg, aIter, &aResult->mTime) &&
-               ReadParam(aMsg, aIter, &aResult->timeStamp) &&
+               ReadParam(aMsg, aIter, &aResult->mTimeStamp) &&
                ReadParam(aMsg, aIter, &aResult->mFlags);
     aResult->mClass = static_cast<mozilla::EventClassID>(eventClassID);
     return ret;
   }
 };
 
 template<>
 struct ParamTraits<mozilla::WidgetGUIEvent>
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6509,17 +6509,17 @@ bool nsWindow::OnGesture(WPARAM wParam, 
 
     WidgetWheelEvent wheelEvent(true, eWheel, this);
 
     ModifierKeyState modifierKeyState;
     modifierKeyState.InitInputEvent(wheelEvent);
 
     wheelEvent.button      = 0;
     wheelEvent.mTime       = ::GetMessageTime();
-    wheelEvent.timeStamp   = GetMessageTimeStamp(wheelEvent.mTime);
+    wheelEvent.mTimeStamp  = GetMessageTimeStamp(wheelEvent.mTime);
     wheelEvent.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
 
     bool endFeedback = true;
 
     if (mGesture.PanDeltaToPixelScroll(wheelEvent)) {
       mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
           (uint32_t) ScrollInputMethod::MainThreadTouch);
       DispatchEvent(&wheelEvent, status);
@@ -6546,17 +6546,17 @@ bool nsWindow::OnGesture(WPARAM wParam, 
     return false; // fall through to DefWndProc
   }
   
   // Polish up and send off the new event
   ModifierKeyState modifierKeyState;
   modifierKeyState.InitInputEvent(event);
   event.button    = 0;
   event.mTime     = ::GetMessageTime();
-  event.timeStamp = GetMessageTimeStamp(event.mTime);
+  event.mTimeStamp = GetMessageTimeStamp(event.mTime);
   event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
 
   nsEventStatus status;
   DispatchEvent(&event, status);
   if (status == nsEventStatus_eIgnore) {
     return false; // Ignored, fall through
   }