Bug 975688 part.8 Rename nsDOMDeviceMotionEvent, nsDOMDeviceAcceleration and nsDOMDeviceRotationRate to mozilla::dom::DeviceMotionEvent, DeviceAcceleration and DeviceRotationRate r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 27 Feb 2014 19:51:12 +0900
changeset 171008 39c3f1e13db045939decc02cb981df1aa5eb01b6
parent 171007 52577b51029a30b2a1eacbebb0b5d64c8ed3a063
child 171009 fd1c82a9839a0b3663b8a1860813a7d80094d4ae
push id26308
push userryanvm@gmail.com
push dateThu, 27 Feb 2014 21:55:01 +0000
treeherdermozilla-central@82508f3c2088 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs975688
milestone30.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 975688 part.8 Rename nsDOMDeviceMotionEvent, nsDOMDeviceAcceleration and nsDOMDeviceRotationRate to mozilla::dom::DeviceMotionEvent, DeviceAcceleration and DeviceRotationRate r=smaug
dom/bindings/Bindings.conf
dom/events/DeviceMotionEvent.cpp
dom/events/DeviceMotionEvent.h
dom/events/moz.build
dom/events/nsDOMDeviceMotionEvent.cpp
dom/events/nsDOMDeviceMotionEvent.h
dom/system/nsDeviceSensors.cpp
dom/system/nsDeviceSensors.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -308,27 +308,21 @@ DOMInterfaces = {
     'workers': True,
 },
 
 'DelayNode': {
     'resultNotAddRefed': [ 'delayTime' ],
 },
 
 'DeviceAcceleration': {
-    'nativeType': 'nsDOMDeviceAcceleration',
-    'headerFile': 'nsDOMDeviceMotionEvent.h',
-},
-
-'DeviceMotionEvent': {
-    'nativeType': 'nsDOMDeviceMotionEvent',
+    'headerFile': 'mozilla/dom/DeviceMotionEvent.h',
 },
 
 'DeviceRotationRate': {
-    'nativeType': 'nsDOMDeviceRotationRate',
-    'headerFile': 'nsDOMDeviceMotionEvent.h',
+    'headerFile': 'mozilla/dom/DeviceMotionEvent.h',
 },
 
 'DeviceStorage': {
     'nativeType': 'nsDOMDeviceStorage',
     'headerFile': 'DeviceStorage.h',
 },
 
 'Document': [
rename from dom/events/nsDOMDeviceMotionEvent.cpp
rename to dom/events/DeviceMotionEvent.cpp
--- a/dom/events/nsDOMDeviceMotionEvent.cpp
+++ b/dom/events/DeviceMotionEvent.cpp
@@ -1,141 +1,160 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsDOMDeviceMotionEvent.h"
+#include "mozilla/dom/DeviceMotionEvent.h"
 #include "nsContentUtils.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_3(nsDOMDeviceMotionEvent, nsDOMEvent,
+/******************************************************************************
+ * DeviceMotionEvent
+ *****************************************************************************/
+
+NS_IMPL_CYCLE_COLLECTION_INHERITED_3(DeviceMotionEvent, nsDOMEvent,
                                      mAcceleration,
                                      mAccelerationIncludingGravity,
                                      mRotationRate)
 
-NS_IMPL_ADDREF_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(DeviceMotionEvent, nsDOMEvent)
+NS_IMPL_RELEASE_INHERITED(DeviceMotionEvent, nsDOMEvent)
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDeviceMotionEvent)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DeviceMotionEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
 void
-nsDOMDeviceMotionEvent::InitDeviceMotionEvent(const nsAString& aType,
-                                              bool aCanBubble,
-                                              bool aCancelable,
-                                              const DeviceAccelerationInit& aAcceleration,
-                                              const DeviceAccelerationInit& aAccelerationIncludingGravity,
-                                              const DeviceRotationRateInit& aRotationRate,
-                                              Nullable<double> aInterval,
-                                              ErrorResult& aRv)
+DeviceMotionEvent::InitDeviceMotionEvent(
+                     const nsAString& aType,
+                     bool aCanBubble,
+                     bool aCancelable,
+                     const DeviceAccelerationInit& aAcceleration,
+                     const DeviceAccelerationInit& aAccelIncludingGravity,
+                     const DeviceRotationRateInit& aRotationRate,
+                     Nullable<double> aInterval,
+                     ErrorResult& aRv)
 {
   aRv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
   if (aRv.Failed()) {
     return;
   }
 
-  mAcceleration = new nsDOMDeviceAcceleration(this, aAcceleration.mX,
-                                              aAcceleration.mY,
-                                              aAcceleration.mZ);
+  mAcceleration = new DeviceAcceleration(this, aAcceleration.mX,
+                                         aAcceleration.mY,
+                                         aAcceleration.mZ);
 
   mAccelerationIncludingGravity =
-    new nsDOMDeviceAcceleration(this, aAccelerationIncludingGravity.mX,
-                                aAccelerationIncludingGravity.mY,
-                                aAccelerationIncludingGravity.mZ);
+    new DeviceAcceleration(this, aAccelIncludingGravity.mX,
+                           aAccelIncludingGravity.mY,
+                           aAccelIncludingGravity.mZ);
 
-  mRotationRate = new nsDOMDeviceRotationRate(this, aRotationRate.mAlpha,
-                                              aRotationRate.mBeta,
-                                              aRotationRate.mGamma);
+  mRotationRate = new DeviceRotationRate(this, aRotationRate.mAlpha,
+                                         aRotationRate.mBeta,
+                                         aRotationRate.mGamma);
   mInterval = aInterval;
 }
 
-already_AddRefed<nsDOMDeviceMotionEvent>
-nsDOMDeviceMotionEvent::Constructor(const GlobalObject& aGlobal,
-                                    const nsAString& aType,
-                                    const DeviceMotionEventInit& aEventInitDict,
-                                    ErrorResult& aRv)
+already_AddRefed<DeviceMotionEvent>
+DeviceMotionEvent::Constructor(const GlobalObject& aGlobal,
+                               const nsAString& aType,
+                               const DeviceMotionEventInit& aEventInitDict,
+                               ErrorResult& aRv)
 {
-  nsCOMPtr<mozilla::dom::EventTarget> t =
-    do_QueryInterface(aGlobal.GetAsSupports());
-  nsRefPtr<nsDOMDeviceMotionEvent> e =
-    new nsDOMDeviceMotionEvent(t, nullptr, nullptr);
+  nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
+  nsRefPtr<DeviceMotionEvent> e = new DeviceMotionEvent(t, nullptr, nullptr);
   aRv = e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable);
   if (aRv.Failed()) {
     return nullptr;
   }
   bool trusted = e->Init(t);
 
-  e->mAcceleration = new nsDOMDeviceAcceleration(e,
+  e->mAcceleration = new DeviceAcceleration(e,
     aEventInitDict.mAcceleration.mX,
     aEventInitDict.mAcceleration.mY,
     aEventInitDict.mAcceleration.mZ);
 
-  e->mAccelerationIncludingGravity = new nsDOMDeviceAcceleration(e,
+  e->mAccelerationIncludingGravity = new DeviceAcceleration(e,
     aEventInitDict.mAccelerationIncludingGravity.mX,
     aEventInitDict.mAccelerationIncludingGravity.mY,
     aEventInitDict.mAccelerationIncludingGravity.mZ);
 
-  e->mRotationRate = new nsDOMDeviceRotationRate(e,
+  e->mRotationRate = new DeviceRotationRate(e,
     aEventInitDict.mRotationRate.mAlpha,
     aEventInitDict.mRotationRate.mBeta,
     aEventInitDict.mRotationRate.mGamma);
 
   e->mInterval = aEventInitDict.mInterval;
   e->SetTrusted(trusted);
 
   return e.forget();
 }
 
+/******************************************************************************
+ * DeviceAcceleration
+ *****************************************************************************/
+
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DeviceAcceleration, mOwner)
+
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DeviceAcceleration, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DeviceAcceleration, Release)
+
+DeviceAcceleration::DeviceAcceleration(DeviceMotionEvent* aOwner,
+                                       Nullable<double> aX,
+                                       Nullable<double> aY,
+                                       Nullable<double> aZ)
+  : mOwner(aOwner)
+  , mX(aX)
+  , mY(aY)
+  , mZ(aZ)
+{
+  SetIsDOMBinding();
+}
+
+DeviceAcceleration::~DeviceAcceleration()
+{
+}
+
+/******************************************************************************
+ * DeviceRotationRate
+ *****************************************************************************/
+
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DeviceRotationRate, mOwner)
+
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DeviceRotationRate, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DeviceRotationRate, Release)
+
+DeviceRotationRate::DeviceRotationRate(DeviceMotionEvent* aOwner,
+                                       Nullable<double> aAlpha,
+                                       Nullable<double> aBeta,
+                                       Nullable<double> aGamma)
+  : mOwner(aOwner)
+  , mAlpha(aAlpha)
+  , mBeta(aBeta)
+  , mGamma(aGamma)
+{
+  SetIsDOMBinding();
+}
+
+DeviceRotationRate::~DeviceRotationRate()
+{
+}
+
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace mozilla::dom;
 
 nsresult
 NS_NewDOMDeviceMotionEvent(nsIDOMEvent** aInstancePtrResult,
-                           mozilla::dom::EventTarget* aOwner,
+                           EventTarget* aOwner,
                            nsPresContext* aPresContext,
                            WidgetEvent* aEvent) 
 {
   NS_ENSURE_ARG_POINTER(aInstancePtrResult);
 
-  nsDOMDeviceMotionEvent* it =
-    new nsDOMDeviceMotionEvent(aOwner, aPresContext, aEvent);
+  DeviceMotionEvent* it = new DeviceMotionEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
-
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsDOMDeviceAcceleration, mOwner)
-
-NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMDeviceAcceleration, AddRef)
-NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMDeviceAcceleration, Release)
-
-nsDOMDeviceAcceleration::nsDOMDeviceAcceleration(nsDOMDeviceMotionEvent* aOwner,
-                                                 Nullable<double> aX,
-                                                 Nullable<double> aY,
-                                                 Nullable<double> aZ)
-: mOwner(aOwner), mX(aX), mY(aY), mZ(aZ)
-{
-  SetIsDOMBinding();
-}
-
-nsDOMDeviceAcceleration::~nsDOMDeviceAcceleration()
-{
-}
-
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsDOMDeviceRotationRate, mOwner)
-
-NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMDeviceRotationRate, AddRef)
-NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMDeviceRotationRate, Release)
-
-nsDOMDeviceRotationRate::nsDOMDeviceRotationRate(nsDOMDeviceMotionEvent* aOwner,
-                                                 Nullable<double> aAlpha,
-                                                 Nullable<double> aBeta,
-                                                 Nullable<double> aGamma)
-: mOwner(aOwner), mAlpha(aAlpha), mBeta(aBeta), mGamma(aGamma)
-{
-  SetIsDOMBinding();
-}
-
-nsDOMDeviceRotationRate::~nsDOMDeviceRotationRate()
-{
-}
rename from dom/events/nsDOMDeviceMotionEvent.h
rename to dom/events/DeviceMotionEvent.h
--- a/dom/events/nsDOMDeviceMotionEvent.h
+++ b/dom/events/DeviceMotionEvent.h
@@ -1,156 +1,161 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef nsDOMDeviceMotionEvent_h__
-#define nsDOMDeviceMotionEvent_h__
+#ifndef mozilla_dom_DeviceMotionEvent_h_
+#define mozilla_dom_DeviceMotionEvent_h_
 
 #include "nsDOMEvent.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/DeviceMotionEventBinding.h"
 
-class nsDOMDeviceRotationRate MOZ_FINAL : public nsWrapperCache
+namespace mozilla {
+namespace dom {
+
+class DeviceRotationRate MOZ_FINAL : public nsWrapperCache
 {
 public:
-  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsDOMDeviceRotationRate)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsDOMDeviceRotationRate)
+  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DeviceRotationRate)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DeviceRotationRate)
 
-  nsDOMDeviceRotationRate(nsDOMDeviceMotionEvent* aOwner,
-                          Nullable<double> aAlpha, Nullable<double> aBeta,
-                          Nullable<double> aGamma);
-  nsDOMDeviceRotationRate(double aAlpha, double aBeta, double aGamma)
+  DeviceRotationRate(DeviceMotionEvent* aOwner,
+                     Nullable<double> aAlpha, Nullable<double> aBeta,
+                     Nullable<double> aGamma);
+  DeviceRotationRate(double aAlpha, double aBeta, double aGamma)
   {
-    nsDOMDeviceRotationRate(nullptr, Nullable<double>(aAlpha),
-                            Nullable<double>(aBeta), Nullable<double>(aGamma));
+    DeviceRotationRate(nullptr, Nullable<double>(aAlpha),
+                       Nullable<double>(aBeta), Nullable<double>(aGamma));
   }
 
-  nsDOMDeviceMotionEvent* GetParentObject() const
+  DeviceMotionEvent* GetParentObject() const
   {
     return mOwner;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::DeviceRotationRateBinding::Wrap(aCx, aScope, this);
+    return DeviceRotationRateBinding::Wrap(aCx, aScope, this);
   }
 
   Nullable<double> GetAlpha() const { return mAlpha; }
   Nullable<double> GetBeta() const { return mBeta; }
   Nullable<double> GetGamma() const { return mGamma; }
 
 private:
-  ~nsDOMDeviceRotationRate();
+  ~DeviceRotationRate();
 
 protected:
-  nsRefPtr<nsDOMDeviceMotionEvent> mOwner;
+  nsRefPtr<DeviceMotionEvent> mOwner;
   Nullable<double> mAlpha, mBeta, mGamma;
 };
 
-class nsDOMDeviceAcceleration MOZ_FINAL : public nsWrapperCache
+class DeviceAcceleration MOZ_FINAL : public nsWrapperCache
 {
 public:
-  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsDOMDeviceAcceleration)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsDOMDeviceAcceleration)
+  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DeviceAcceleration)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DeviceAcceleration)
 
-  nsDOMDeviceAcceleration(nsDOMDeviceMotionEvent* aOwner,
-                          Nullable<double> aX, Nullable<double> aY,
-                          Nullable<double> aZ);
-  nsDOMDeviceAcceleration(double aX, double aY, double aZ)
+  DeviceAcceleration(DeviceMotionEvent* aOwner,
+                     Nullable<double> aX, Nullable<double> aY,
+                     Nullable<double> aZ);
+  DeviceAcceleration(double aX, double aY, double aZ)
   {
-    nsDOMDeviceAcceleration(nullptr, Nullable<double>(aX),
-                            Nullable<double>(aY), Nullable<double>(aZ));
+    DeviceAcceleration(nullptr, Nullable<double>(aX),
+                       Nullable<double>(aY), Nullable<double>(aZ));
   }
 
-  nsDOMDeviceMotionEvent* GetParentObject() const
+  DeviceMotionEvent* GetParentObject() const
   {
     return mOwner;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::DeviceAccelerationBinding::Wrap(aCx, aScope, this);
+    return DeviceAccelerationBinding::Wrap(aCx, aScope, this);
   }
 
   Nullable<double> GetX() const { return mX; }
   Nullable<double> GetY() const { return mY; }
   Nullable<double> GetZ() const { return mZ; }
 
 private:
-  ~nsDOMDeviceAcceleration();
+  ~DeviceAcceleration();
 
 protected:
-  nsRefPtr<nsDOMDeviceMotionEvent> mOwner;
+  nsRefPtr<DeviceMotionEvent> mOwner;
   Nullable<double> mX, mY, mZ;
 };
 
-class nsDOMDeviceMotionEvent MOZ_FINAL : public nsDOMEvent
+class DeviceMotionEvent MOZ_FINAL : public nsDOMEvent
 {
-  typedef mozilla::dom::DeviceAccelerationInit DeviceAccelerationInit;
-  typedef mozilla::dom::DeviceRotationRateInit DeviceRotationRateInit;
 public:
 
-  nsDOMDeviceMotionEvent(mozilla::dom::EventTarget* aOwner,
-                         nsPresContext* aPresContext,
-                         mozilla::WidgetEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent)
+  DeviceMotionEvent(EventTarget* aOwner,
+                    nsPresContext* aPresContext,
+                    WidgetEvent* aEvent)
+    : nsDOMEvent(aOwner, aPresContext, aEvent)
   {
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Forward to nsDOMEvent
   NS_FORWARD_TO_NSDOMEVENT
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeviceMotionEvent, nsDOMEvent)
 
   virtual JSObject* WrapObject(JSContext* aCx,
-			       JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
+                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::DeviceMotionEventBinding::Wrap(aCx, aScope, this);
+    return DeviceMotionEventBinding::Wrap(aCx, aScope, this);
   }
 
-  nsDOMDeviceAcceleration* GetAcceleration() const
+  DeviceAcceleration* GetAcceleration() const
   {
     return mAcceleration;
   }
 
-  nsDOMDeviceAcceleration* GetAccelerationIncludingGravity() const
+  DeviceAcceleration* GetAccelerationIncludingGravity() const
   {
     return mAccelerationIncludingGravity;
   }
 
-  nsDOMDeviceRotationRate* GetRotationRate() const
+  DeviceRotationRate* GetRotationRate() const
   {
     return mRotationRate;
   }
 
   Nullable<double> GetInterval() const
   {
     return mInterval;
   }
 
-  void InitDeviceMotionEvent(const nsAString& aType,
-                             bool aCanBubble,
-                             bool aCancelable,
-                             const DeviceAccelerationInit& aAcceleration,
-                             const DeviceAccelerationInit& aAccelerationIncludingGravity,
-                             const DeviceRotationRateInit& aRotationRate,
-                             Nullable<double> aInterval,
-                             mozilla::ErrorResult& aRv);
+  void InitDeviceMotionEvent(
+         const nsAString& aType,
+         bool aCanBubble,
+         bool aCancelable,
+         const DeviceAccelerationInit& aAcceleration,
+         const DeviceAccelerationInit& aAccelerationIncludingGravity,
+         const DeviceRotationRateInit& aRotationRate,
+         Nullable<double> aInterval,
+         ErrorResult& aRv);
 
-  static already_AddRefed<nsDOMDeviceMotionEvent>
-  Constructor(const mozilla::dom::GlobalObject& aGlobal,
+  static already_AddRefed<DeviceMotionEvent>
+  Constructor(const GlobalObject& aGlobal,
               const nsAString& aType,
-              const mozilla::dom::DeviceMotionEventInit& aEventInitDict,
-              mozilla::ErrorResult& aRv);
+              const DeviceMotionEventInit& aEventInitDict,
+              ErrorResult& aRv);
 
 protected:
-  nsRefPtr<nsDOMDeviceAcceleration> mAcceleration;
-  nsRefPtr<nsDOMDeviceAcceleration> mAccelerationIncludingGravity;
-  nsRefPtr<nsDOMDeviceRotationRate> mRotationRate;
+  nsRefPtr<DeviceAcceleration> mAcceleration;
+  nsRefPtr<DeviceAcceleration> mAccelerationIncludingGravity;
+  nsRefPtr<DeviceRotationRate> mRotationRate;
   Nullable<double> mInterval;
 };
 
-#endif
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_DeviceMotionEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -38,16 +38,17 @@ EXPORTS.mozilla += [
 EXPORTS.mozilla.dom += [
     'AnimationEvent.h',
     'BeforeUnloadEvent.h',
     'ClipboardEvent.h',
     'CommandEvent.h',
     'CompositionEvent.h',
     'DataContainerEvent.h',
     'DataTransfer.h',
+    'DeviceMotionEvent.h',
     'EventTarget.h',
     'PointerEvent.h',
     'Touch.h',
     'WheelEvent.h',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
@@ -55,20 +56,20 @@ if CONFIG['MOZ_WEBSPEECH']:
 UNIFIED_SOURCES += [
     'AnimationEvent.cpp',
     'BeforeUnloadEvent.cpp',
     'ClipboardEvent.cpp',
     'CommandEvent.cpp',
     'CompositionEvent.cpp',
     'DataContainerEvent.cpp',
     'DataTransfer.cpp',
+    'DeviceMotionEvent.cpp',
     'EventTarget.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
-    'nsDOMDeviceMotionEvent.cpp',
     'nsDOMDragEvent.cpp',
     'nsDOMEventTargetHelper.cpp',
     'nsDOMFocusEvent.cpp',
     'nsDOMKeyboardEvent.cpp',
     'nsDOMMessageEvent.cpp',
     'nsDOMMouseEvent.cpp',
     'nsDOMMouseScrollEvent.cpp',
     'nsDOMMutationEvent.cpp',
--- a/dom/system/nsDeviceSensors.cpp
+++ b/dom/system/nsDeviceSensors.cpp
@@ -387,17 +387,17 @@ nsDeviceSensors::FireDOMMotionEvent(nsID
              mLastAccelerationIncluduingGravity.empty() ||
              mLastRotationRate.empty()) {
     return;
   }
 
   nsCOMPtr<nsIDOMEvent> event;
   domdoc->CreateEvent(NS_LITERAL_STRING("DeviceMotionEvent"), getter_AddRefs(event));
 
-  nsDOMDeviceMotionEvent* me = static_cast<nsDOMDeviceMotionEvent*>(event.get());
+  DeviceMotionEvent* me = static_cast<DeviceMotionEvent*>(event.get());
 
   ErrorResult rv;
   me->InitDeviceMotionEvent(NS_LITERAL_STRING("devicemotion"),
                             true,
                             false,
                             mLastAcceleration.ref(),
                             mLastAccelerationIncluduingGravity.ref(),
                             mLastRotationRate.ref(),
--- a/dom/system/nsDeviceSensors.h
+++ b/dom/system/nsDeviceSensors.h
@@ -6,17 +6,17 @@
 #define nsDeviceSensors_h
 
 #include "nsIDeviceSensors.h"
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsCOMPtr.h"
 #include "nsITimer.h"
 #include "nsIDOMDeviceOrientationEvent.h"
-#include "nsDOMDeviceMotionEvent.h"
+#include "mozilla/dom/DeviceMotionEvent.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/HalSensor.h"
 #include "nsDataHashtable.h"
 
 class nsIDOMWindow;
 
 namespace mozilla {
 namespace dom {