Bug 920425 part.23 Use mozilla::WidgetEvent::AsUIEvent() r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 18 Oct 2013 15:10:25 +0900
changeset 151207 c607e72bfe0ce6533727c8b3e694ddc327265ce8
parent 151206 3f95a3a1873cac44f954fd9a2a8f0d7579d7615c
child 151208 31bcb9ec1eff0ffe310929601f4457c280d48743
push id35111
push usermasayuki@d-toybox.com
push dateFri, 18 Oct 2013 06:10:43 +0000
treeherdermozilla-inbound@bc72b42bcf76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs920425
milestone27.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 920425 part.23 Use mozilla::WidgetEvent::AsUIEvent() r=smaug
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMUIEvent.cpp
content/smil/nsDOMTimeEvent.cpp
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -664,17 +664,17 @@ nsDOMEvent::DuplicatePrivateData()
         new WidgetCommandEvent(false, mEvent->userType,
                                oldCommandEvent->command, nullptr);
       commandEvent->AssignCommandEventData(*oldCommandEvent, true);
       newEvent = commandEvent;
       break;
     }
     case NS_UI_EVENT:
     {
-      InternalUIEvent* oldUIEvent = static_cast<InternalUIEvent*>(mEvent);
+      InternalUIEvent* oldUIEvent = mEvent->AsUIEvent();
       InternalUIEvent* uiEvent =
         new InternalUIEvent(false, msg, oldUIEvent->detail);
       uiEvent->AssignUIEventData(*oldUIEvent, true);
       newEvent = uiEvent;
       break;
     }
     case NS_SVGZOOM_EVENT:
     {
@@ -682,17 +682,17 @@ nsDOMEvent::DuplicatePrivateData()
       WidgetGUIEvent* guiEvent = new WidgetGUIEvent(false, msg, nullptr);
       guiEvent->eventStructType = NS_SVGZOOM_EVENT;
       guiEvent->AssignGUIEventData(*oldGUIEvent, true);
       newEvent = guiEvent;
       break;
     }
     case NS_SMIL_TIME_EVENT:
     {
-      InternalUIEvent* oldUIEvent = static_cast<InternalUIEvent*>(mEvent);
+      InternalUIEvent* oldUIEvent = mEvent->AsUIEvent();
       InternalUIEvent* uiEvent = new InternalUIEvent(false, msg, 0);
       uiEvent->eventStructType = NS_SMIL_TIME_EVENT;
       uiEvent->AssignUIEventData(*oldUIEvent, true);
       newEvent = uiEvent;
       break;
     }
     case NS_SIMPLE_GESTURE_EVENT:
     {
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -39,18 +39,17 @@ nsDOMUIEvent::nsDOMUIEvent(mozilla::dom:
   }
   
   // Fill mDetail and mView according to the mEvent (widget-generated
   // event) we've got
   switch(mEvent->eventStructType)
   {
     case NS_UI_EVENT:
     {
-      InternalUIEvent *event = static_cast<InternalUIEvent*>(mEvent);
-      mDetail = event->detail;
+      mDetail = mEvent->AsUIEvent()->detail;
       break;
     }
 
     case NS_SCROLLPORT_EVENT:
     {
       InternalScrollPortEvent* scrollEvent = mEvent->AsScrollPortEvent();
       mDetail = (int32_t)scrollEvent->orient;
       break;
--- a/content/smil/nsDOMTimeEvent.cpp
+++ b/content/smil/nsDOMTimeEvent.cpp
@@ -21,18 +21,17 @@ nsDOMTimeEvent::nsDOMTimeEvent(mozilla::
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->eventStructType = NS_SMIL_TIME_EVENT;
   }
 
   if (mEvent->eventStructType == NS_SMIL_TIME_EVENT) {
-    InternalUIEvent* event = static_cast<InternalUIEvent*>(mEvent);
-    mDetail = event->detail;
+    mDetail = mEvent->AsUIEvent()->detail;
   }
 
   mEvent->mFlags.mBubbles = false;
   mEvent->mFlags.mCancelable = false;
 
   if (mPresContext) {
     nsCOMPtr<nsISupports> container = mPresContext->GetContainer();
     if (container) {