Bug 1259661 part.2 Rename WidgetMouseEvent::context to WidgetMouseEvent::ContextMenuTrigger r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 12 May 2016 11:28:14 +0900
changeset 297101 80e5afeea2ce8b4c81d8099fac88f93b77836235
parent 297100 76a7cdabdd506567e043db46163829786fd08732
child 297102 31c295b95ce8d21e6d0a35c34f535601dcdd1c4c
push id30251
push usercbook@mozilla.com
push dateThu, 12 May 2016 09:54:48 +0000
treeherdermozilla-central@c3f5e6079284 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1259661
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1259661 part.2 Rename WidgetMouseEvent::context to WidgetMouseEvent::ContextMenuTrigger r=smaug MozReview-Commit-ID: 2amULUnzsxc
widget/MouseEvents.h
widget/nsGUIEventIPC.h
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -183,59 +183,61 @@ private:
 public:
   typedef bool ReasonType;
   enum Reason : ReasonType
   {
     eReal,
     eSynthesized
   };
 
-  enum contextType
+  typedef bool ContextMenuTriggerType;
+  enum ContextMenuTrigger : ContextMenuTriggerType
   {
     eNormal,
     eContextMenuKey
   };
 
   enum exitType
   {
     eChild,
     eTopLevel
   };
 
 protected:
   WidgetMouseEvent()
     : reason(eReal)
+    , context(eNormal)
     , acceptActivation(false)
     , ignoreRootScrollFrame(false)
     , clickCount(0)
   {
   }
 
   WidgetMouseEvent(bool aIsTrusted, EventMessage aMessage, nsIWidget* aWidget,
                    EventClassID aEventClassID, Reason aReason)
     : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, aEventClassID)
     , reason(aReason)
+    , context(eNormal)
     , acceptActivation(false)
     , ignoreRootScrollFrame(false)
-    , context(eNormal)
     , exit(eChild)
     , clickCount(0)
   {
   }
 
 public:
   virtual WidgetMouseEvent* AsMouseEvent() override { return this; }
 
   WidgetMouseEvent(bool aIsTrusted, EventMessage aMessage, nsIWidget* aWidget,
-                   Reason aReason, contextType aContext = eNormal)
+                   Reason aReason, ContextMenuTrigger aContext = eNormal)
     : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, eMouseEventClass)
     , reason(aReason)
+    , context(aContext)
     , acceptActivation(false)
     , ignoreRootScrollFrame(false)
-    , context(aContext)
     , exit(eChild)
     , clickCount(0)
   {
     if (aMessage == eContextMenu) {
       button = (context == eNormal) ? eRightButton : eLeftButton;
     }
   }
 
@@ -258,23 +260,24 @@ public:
       new WidgetMouseEvent(false, mMessage, nullptr, reason, context);
     result->AssignMouseEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }
 
   Reason reason;
 
+  ContextMenuTrigger context;
+
   // Special return code for MOUSE_ACTIVATE to signal.
   // If the target accepts activation (1), or denies it (0).
   bool acceptActivation;
   // Whether the event should ignore scroll frame bounds during dispatch.
   bool ignoreRootScrollFrame;
 
-  contextType context : 4;
   exitType exit;
 
   /// The number of mouse clicks.
   uint32_t clickCount;
 
   void AssignMouseEventData(const WidgetMouseEvent& aEvent, bool aCopyTargets)
   {
     AssignMouseEventBaseData(aEvent, aCopyTargets);
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -227,36 +227,38 @@ struct ParamTraits<mozilla::WidgetMouseE
 {
   typedef mozilla::WidgetMouseEvent paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam));
     WriteParam(aMsg, aParam.ignoreRootScrollFrame);
     WriteParam(aMsg, static_cast<paramType::ReasonType>(aParam.reason));
-    WriteParam(aMsg, (uint8_t) aParam.context);
+    WriteParam(aMsg,
+               static_cast<paramType::ContextMenuTriggerType>(aParam.context));
     WriteParam(aMsg, (uint8_t) aParam.exit);
     WriteParam(aMsg, aParam.clickCount);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     bool rv;
     paramType::ReasonType reason = 0;
-    uint8_t context = 0, exit = 0;
+    paramType::ContextMenuTriggerType contextMenuTrigger = 0;
+    uint8_t exit = 0;
     rv = ReadParam(aMsg, aIter,
                    static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
          ReadParam(aMsg, aIter, &aResult->ignoreRootScrollFrame) &&
          ReadParam(aMsg, aIter, &reason) &&
-         ReadParam(aMsg, aIter, &context) &&
+         ReadParam(aMsg, aIter, &contextMenuTrigger) &&
          ReadParam(aMsg, aIter, &exit) &&
          ReadParam(aMsg, aIter, &aResult->clickCount);
     aResult->reason = static_cast<paramType::Reason>(reason);
     aResult->context =
-      static_cast<mozilla::WidgetMouseEvent::contextType>(context);
+      static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger);
     aResult->exit = static_cast<mozilla::WidgetMouseEvent::exitType>(exit);
     return rv;
   }
 };
 
 
 template<>
 struct ParamTraits<mozilla::WidgetDragEvent>