Bug 734855 - Rename DeviceMotion to DeviceSensors. r=mwu
authorDoug Turner <dougt@dougt.org>
Sat, 24 Mar 2012 17:29:57 -0700
changeset 93582 df108e67c87ac98ea770de65ac97dfb4f587f70a
parent 93581 246d43704fc75ed25187ca44917e06590ecc64ca
child 93583 b3b3928b2c0faf3c5d24a56a4812aa86e9ccd0a3
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs734855
milestone14.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 734855 - Rename DeviceMotion to DeviceSensors. r=mwu
dom/base/nsGlobalWindow.cpp
dom/system/Makefile.in
dom/system/nsDeviceMotion.cpp
dom/system/nsDeviceMotion.h
dom/system/nsDeviceSensors.cpp
dom/system/nsDeviceSensors.h
layout/build/nsLayoutModule.cpp
xpcom/system/Makefile.in
xpcom/system/nsIDeviceMotion.idl
xpcom/system/nsIDeviceSensors.idl
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -106,17 +106,17 @@
 #include "nsDOMMediaQueryList.h"
 #include "mozilla/dom/workers/Workers.h"
 
 // Interfaces Needed
 #include "nsIFrame.h"
 #include "nsCanvasFrame.h"
 #include "nsIWidget.h"
 #include "nsIBaseWindow.h"
-#include "nsDeviceMotion.h"
+#include "nsDeviceSensors.h"
 #include "nsIContent.h"
 #include "nsIContentViewerEdit.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellLoadInfo.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeNode.h"
 #include "nsIEditorDocShell.h"
 #include "nsIDocCharset.h"
@@ -1107,17 +1107,17 @@ nsGlobalWindow::~nsGlobalWindow()
 #ifdef DEBUG
   nsCycleCollector_DEBUG_wasFreed(static_cast<nsIScriptGlobalObject*>(this));
 #endif
 
   if (mURLProperty) {
     mURLProperty->ClearWindowReference();
   }
 
-  nsCOMPtr<nsIDeviceMotion> ac = do_GetService(NS_DEVICE_MOTION_CONTRACTID);
+  nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
   if (ac)
     ac->RemoveWindowAsListener(this);
 
   nsLayoutStatics::Release();
 }
 
 void
 nsGlobalWindow::AddEventTargetObject(nsDOMEventTargetHelper* aObject)
@@ -10114,17 +10114,17 @@ nsGlobalWindow::SuspendTimeouts(PRUint32
                                 bool aFreezeChildren)
 {
   FORWARD_TO_INNER_VOID(SuspendTimeouts, (aIncrease, aFreezeChildren));
 
   bool suspended = (mTimeoutsSuspendDepth != 0);
   mTimeoutsSuspendDepth += aIncrease;
 
   if (!suspended) {
-    nsCOMPtr<nsIDeviceMotion> ac = do_GetService(NS_DEVICE_MOTION_CONTRACTID);
+    nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
     if (ac) {
       for (int i = 0; i < mEnabledSensors.Length(); i++)
         ac->RemoveWindowListener(mEnabledSensors[i], this);
     }
 
     // Suspend all of the workers for this window.
     nsIScriptContext *scx = GetContextInternal();
     JSContext *cx = scx ? scx->GetNativeContext() : nsnull;
@@ -10194,17 +10194,17 @@ nsGlobalWindow::ResumeTimeouts(bool aTha
   FORWARD_TO_INNER(ResumeTimeouts, (), NS_ERROR_NOT_INITIALIZED);
 
   NS_ASSERTION(mTimeoutsSuspendDepth, "Mismatched calls to ResumeTimeouts!");
   --mTimeoutsSuspendDepth;
   bool shouldResume = (mTimeoutsSuspendDepth == 0);
   nsresult rv;
 
   if (shouldResume) {
-    nsCOMPtr<nsIDeviceMotion> ac = do_GetService(NS_DEVICE_MOTION_CONTRACTID);
+    nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
     if (ac) {
       for (int i = 0; i < mEnabledSensors.Length(); i++)
         ac->AddWindowListener(mEnabledSensors[i], this);
     }
 
     // Resume all of the workers for this window.
     nsIScriptContext *scx = GetContextInternal();
     JSContext *cx = scx ? scx->GetNativeContext() : nsnull;
@@ -10316,17 +10316,17 @@ nsGlobalWindow::EnableDeviceSensor(PRUin
     }
   }
 
   if (alreadyEnabled)
     return;
 
   mEnabledSensors.AppendElement(aType);
 
-  nsCOMPtr<nsIDeviceMotion> ac = do_GetService(NS_DEVICE_MOTION_CONTRACTID);
+  nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
   if (ac)
     ac->AddWindowListener(aType, this);
 }
 
 void
 nsGlobalWindow::DisableDeviceSensor(PRUint32 aType)
 {
   PRUint32 doomedElement = -1;
@@ -10337,17 +10337,17 @@ nsGlobalWindow::DisableDeviceSensor(PRUi
     }
   }
 
   if (doomedElement == -1)
     return;
 
   mEnabledSensors.RemoveElementAt(doomedElement);
 
-  nsCOMPtr<nsIDeviceMotion> ac = do_GetService(NS_DEVICE_MOTION_CONTRACTID);
+  nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
   if (ac)
     ac->RemoveWindowListener(aType, this);
 }
 
 NS_IMETHODIMP
 nsGlobalWindow::GetURL(nsIDOMMozURLProperty** aURL)
 {
   FORWARD_TO_INNER(GetURL, (aURL), NS_ERROR_UNEXPECTED);
--- a/dom/system/Makefile.in
+++ b/dom/system/Makefile.in
@@ -57,17 +57,17 @@ ifneq (,$(filter android,$(MOZ_WIDGET_TO
 DIRS = android
 endif
 
 ifdef MOZ_B2G_RIL
 DIRS += gonk
 endif
 
 CPPSRCS     = \
-  nsDeviceMotion.cpp \
+  nsDeviceSensors.cpp \
   $(NULL)
 
 # We fire the nsDOMDeviceAcceleration
 LOCAL_INCLUDES += -I$(topsrcdir)/content/events/src
 
 # On Systems that have build in geolocation providers,
 # we really do not need these.
 ifneq (Android,$(OS_TARGET))
@@ -75,17 +75,17 @@ EXTRA_COMPONENTS = \
   NetworkGeolocationProvider.js \
   NetworkGeolocationProvider.manifest \
   GPSDGeolocationProvider.js \
   GPSDGeolocationProvider.manifest \
   $(NULL)
 endif
 
 EXPORTS     = \
-  nsDeviceMotion.h \
+  nsDeviceSensors.h \
   $(NULL)
 
 # We fire the nsDOMDeviceAcceleration
 LOCAL_INCLUDES += -I$(topsrcdir)/content/events/src
 
 include $(topsrcdir)/config/config.mk
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
rename from dom/system/nsDeviceMotion.cpp
rename to dom/system/nsDeviceSensors.cpp
--- a/dom/system/nsDeviceMotion.cpp
+++ b/dom/system/nsDeviceSensors.cpp
@@ -32,17 +32,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "mozilla/Hal.h"
 #include "mozilla/HalSensor.h"
 
-#include "nsDeviceMotion.h"
+#include "nsDeviceSensors.h"
 
 #include "nsAutoPtr.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIServiceManager.h"
@@ -54,79 +54,79 @@ using namespace mozilla;
 using namespace hal;
 
 // also see sDefaultSensorHint in mobile/android/base/GeckoAppShell.java
 #define DEFAULT_SENSOR_POLL 100
 
 static const nsTArray<nsIDOMWindow*>::index_type NoIndex =
   nsTArray<nsIDOMWindow*>::NoIndex;
 
-class nsDeviceMotionData : public nsIDeviceMotionData
+class nsDeviceSensorData : public nsIDeviceSensorData
 {
 public:
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIDEVICEMOTIONDATA
+  NS_DECL_NSIDEVICESENSORDATA
 
-  nsDeviceMotionData(unsigned long type, double x, double y, double z);
+  nsDeviceSensorData(unsigned long type, double x, double y, double z);
 
 private:
-  ~nsDeviceMotionData();
+  ~nsDeviceSensorData();
 
 protected:
   unsigned long mType;
   double mX, mY, mZ;
 };
 
-nsDeviceMotionData::nsDeviceMotionData(unsigned long type, double x, double y, double z)
+nsDeviceSensorData::nsDeviceSensorData(unsigned long type, double x, double y, double z)
   : mType(type), mX(x), mY(y), mZ(z)
 {
 }
 
-NS_INTERFACE_MAP_BEGIN(nsDeviceMotionData)
-NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDeviceMotionData)
+NS_INTERFACE_MAP_BEGIN(nsDeviceSensorData)
+NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDeviceSensorData)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_ADDREF(nsDeviceMotionData)
-NS_IMPL_RELEASE(nsDeviceMotionData)
+NS_IMPL_ADDREF(nsDeviceSensorData)
+NS_IMPL_RELEASE(nsDeviceSensorData)
 
-nsDeviceMotionData::~nsDeviceMotionData()
+nsDeviceSensorData::~nsDeviceSensorData()
 {
 }
 
-NS_IMETHODIMP nsDeviceMotionData::GetType(PRUint32 *aType)
+NS_IMETHODIMP nsDeviceSensorData::GetType(PRUint32 *aType)
 {
   NS_ENSURE_ARG_POINTER(aType);
   *aType = mType;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDeviceMotionData::GetX(double *aX)
+NS_IMETHODIMP nsDeviceSensorData::GetX(double *aX)
 {
   NS_ENSURE_ARG_POINTER(aX);
   *aX = mX;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDeviceMotionData::GetY(double *aY)
+NS_IMETHODIMP nsDeviceSensorData::GetY(double *aY)
 {
   NS_ENSURE_ARG_POINTER(aY);
   *aY = mY;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDeviceMotionData::GetZ(double *aZ)
+NS_IMETHODIMP nsDeviceSensorData::GetZ(double *aZ)
 {
   NS_ENSURE_ARG_POINTER(aZ);
   *aZ = mZ;
   return NS_OK;
 }
 
-NS_IMPL_ISUPPORTS1(nsDeviceMotion, nsIDeviceMotion)
+NS_IMPL_ISUPPORTS1(nsDeviceSensors, nsIDeviceSensors)
 
-nsDeviceMotion::nsDeviceMotion()
+nsDeviceSensors::nsDeviceSensors()
 : mEnabled(true)
 {
   mLastDOMMotionEventTime = TimeStamp::Now();
 
   nsCOMPtr<nsIPrefBranch> prefSrv = do_GetService(NS_PREFSERVICE_CONTRACTID);
   if (prefSrv) {
     bool bvalue;
     nsresult rv = prefSrv->GetBoolPref("device.motion.enabled", &bvalue);
@@ -137,61 +137,61 @@ nsDeviceMotion::nsDeviceMotion()
   for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
     nsTArray<nsIDOMWindow*> *windows = new nsTArray<nsIDOMWindow*>();
     mWindowListeners.AppendElement(windows);
   }
 
   mLastDOMMotionEventTime = TimeStamp::Now();
 }
 
-nsDeviceMotion::~nsDeviceMotion()
+nsDeviceSensors::~nsDeviceSensors()
 {
   for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
     if (IsSensorEnabled(i))  
       UnregisterSensorObserver((SensorType)i, this);
   }
 
   for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
     delete mWindowListeners[i];
   }
 }
 
-NS_IMETHODIMP nsDeviceMotion::AddWindowListener(PRUint32 aType, nsIDOMWindow *aWindow)
+NS_IMETHODIMP nsDeviceSensors::AddWindowListener(PRUint32 aType, nsIDOMWindow *aWindow)
 {
   if (mWindowListeners[aType]->IndexOf(aWindow) != NoIndex)
     return NS_OK;
 
   if (!IsSensorEnabled(aType)) {
     RegisterSensorObserver((SensorType)aType, this);
   }
 
   mWindowListeners[aType]->AppendElement(aWindow);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDeviceMotion::RemoveWindowListener(PRUint32 aType, nsIDOMWindow *aWindow)
+NS_IMETHODIMP nsDeviceSensors::RemoveWindowListener(PRUint32 aType, nsIDOMWindow *aWindow)
 {
   if (mWindowListeners[aType]->IndexOf(aWindow) == NoIndex)
     return NS_OK;
 
   mWindowListeners[aType]->RemoveElement(aWindow);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDeviceMotion::RemoveWindowAsListener(nsIDOMWindow *aWindow)
+NS_IMETHODIMP nsDeviceSensors::RemoveWindowAsListener(nsIDOMWindow *aWindow)
 {
   for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
     if (IsSensorEnabled(i))
         RemoveWindowListener((SensorType)i, aWindow);
   }
   return NS_OK;
 }
 
 void 
-nsDeviceMotion::Notify(const mozilla::hal::SensorData& aSensorData)
+nsDeviceSensors::Notify(const mozilla::hal::SensorData& aSensorData)
 {
   if (!mEnabled)
     return;
 
   PRUint32 type = aSensorData.sensor();
 
   double x = aSensorData.values()[0];
   double y = aSensorData.values()[1];
@@ -213,28 +213,28 @@ nsDeviceMotion::Notify(const mozilla::ha
         pwindow->GetOuterWindow()->IsBackground())
       continue;
 
     nsCOMPtr<nsIDOMDocument> domdoc;
     windowListeners[i]->GetDocument(getter_AddRefs(domdoc));
 
     if (domdoc) {
       nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(windowListeners[i]);
-      if (type == nsIDeviceMotionData::TYPE_ACCELERATION || 
-        type == nsIDeviceMotionData::TYPE_LINEAR_ACCELERATION || 
-        type == nsIDeviceMotionData::TYPE_GYROSCOPE)
+      if (type == nsIDeviceSensorData::TYPE_ACCELERATION || 
+        type == nsIDeviceSensorData::TYPE_LINEAR_ACCELERATION || 
+        type == nsIDeviceSensorData::TYPE_GYROSCOPE)
         FireDOMMotionEvent(domdoc, target, type, x, y, z);
-      else if (type == nsIDeviceMotionData::TYPE_ORIENTATION)
+      else if (type == nsIDeviceSensorData::TYPE_ORIENTATION)
         FireDOMOrientationEvent(domdoc, target, x, y, z);
     }
   }
 }
 
 void
-nsDeviceMotion::FireDOMOrientationEvent(nsIDOMDocument *domdoc,
+nsDeviceSensors::FireDOMOrientationEvent(nsIDOMDocument *domdoc,
                                         nsIDOMEventTarget *target,
                                         double alpha,
                                         double beta,
                                         double gamma)
 {
   nsCOMPtr<nsIDOMEvent> event;
   bool defaultActionEnabled = true;
   domdoc->CreateEvent(NS_LITERAL_STRING("DeviceOrientationEvent"), getter_AddRefs(event));
@@ -257,33 +257,33 @@ nsDeviceMotion::FireDOMOrientationEvent(
   if (privateEvent)
     privateEvent->SetTrusted(true);
   
   target->DispatchEvent(event, &defaultActionEnabled);
 }
 
 
 void
-nsDeviceMotion::FireDOMMotionEvent(nsIDOMDocument *domdoc,
+nsDeviceSensors::FireDOMMotionEvent(nsIDOMDocument *domdoc,
                                    nsIDOMEventTarget *target,
                                    PRUint32 type,
                                    double x,
                                    double y,
                                    double z) {
   // Attempt to coalesce events
   bool fireEvent = TimeStamp::Now() > mLastDOMMotionEventTime + TimeDuration::FromMilliseconds(DEFAULT_SENSOR_POLL);
 
   switch (type) {
-  case nsIDeviceMotionData::TYPE_LINEAR_ACCELERATION:
+  case nsIDeviceSensorData::TYPE_LINEAR_ACCELERATION:
     mLastAcceleration = new nsDOMDeviceAcceleration(x, y, z);
     break;
-  case nsIDeviceMotionData::TYPE_ACCELERATION:
+  case nsIDeviceSensorData::TYPE_ACCELERATION:
     mLastAccelerationIncluduingGravity = new nsDOMDeviceAcceleration(x, y, z);
     break;
-  case nsIDeviceMotionData::TYPE_GYROSCOPE:
+  case nsIDeviceSensorData::TYPE_GYROSCOPE:
     mLastRotationRate = new nsDOMDeviceRotationRate(x, y, z);
     break;
   }
 
   if (!fireEvent && (!mLastAcceleration || !mLastAccelerationIncluduingGravity || !mLastRotationRate)) {
     return;
   }
 
rename from dom/system/nsDeviceMotion.h
rename to dom/system/nsDeviceSensors.h
--- a/dom/system/nsDeviceMotion.h
+++ b/dom/system/nsDeviceSensors.h
@@ -29,49 +29,49 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef nsDeviceMotion_h
-#define nsDeviceMotion_h
+#ifndef nsDeviceSensors_h
+#define nsDeviceSensors_h
 
-#include "nsIDeviceMotion.h"
+#include "nsIDeviceSensors.h"
 #include "nsIDOMDeviceMotionEvent.h"
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsCOMPtr.h"
 #include "nsITimer.h"
 #include "nsIDOMDeviceOrientationEvent.h"
 #include "nsIDOMDeviceMotionEvent.h"
 #include "nsDOMDeviceMotionEvent.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/HalSensor.h"
 #include "nsDataHashtable.h"
 
-#define NS_DEVICE_MOTION_CID \
+#define NS_DEVICE_SENSORS_CID \
 { 0xecba5203, 0x77da, 0x465a, \
 { 0x86, 0x5e, 0x78, 0xb7, 0xaf, 0x10, 0xd8, 0xf7 } }
 
-#define NS_DEVICE_MOTION_CONTRACTID "@mozilla.org/devicemotion;1"
+#define NS_DEVICE_SENSORS_CONTRACTID "@mozilla.org/devicesensors;1"
 
 class nsIDOMWindow;
 
-class nsDeviceMotion : public nsIDeviceMotion, public mozilla::hal::ISensorObserver
+class nsDeviceSensors : public nsIDeviceSensors, public mozilla::hal::ISensorObserver
 {
 public:
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIDEVICEMOTION
+  NS_DECL_NSIDEVICESENSORS
 
-  nsDeviceMotion();
+  nsDeviceSensors();
 
-  virtual ~nsDeviceMotion();
+  virtual ~nsDeviceSensors();
 
   void Notify(const mozilla::hal::SensorData& aSensorData);
 
 private:
   // sensor -> window listener
   nsTArray<nsTArray<nsIDOMWindow*>* > mWindowListeners;
   
   // window -> sensortype enabled
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -237,17 +237,17 @@ NS_NewXULTreeBuilder(nsISupports* aOuter
 static void Shutdown();
 
 #ifdef MOZ_XTF
 #include "nsIXTFService.h"
 #include "nsIXMLContentBuilder.h"
 #endif
 
 #include "nsGeolocation.h"
-#include "nsDeviceMotion.h"
+#include "nsDeviceSensors.h"
 #include "nsCSPService.h"
 #include "nsISmsService.h"
 #include "nsISmsDatabaseService.h"
 #include "mozilla/dom/sms/SmsRequestManager.h"
 #include "mozilla/dom/sms/SmsServicesFactory.h"
 #include "nsIPowerManagerService.h"
 
 using namespace mozilla::dom::sms;
@@ -286,17 +286,17 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR
 #ifdef MOZ_B2G_RIL
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager,
                                          SystemWorkerManager::FactoryCreate)
 #endif
 
 #ifdef MOZ_WIDGET_GONK
 NS_GENERIC_FACTORY_CONSTRUCTOR(AudioManager)
 #endif
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceMotion)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors)
 
 #ifndef MOZ_WIDGET_GONK
 #if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback)
 #endif
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISmsService, SmsServicesFactory::CreateSmsService)
@@ -777,17 +777,17 @@ NS_DEFINE_NAMED_CID(NS_CHILDPROCESSMESSA
 NS_DEFINE_NAMED_CID(NSCHANNELPOLICY_CID);
 NS_DEFINE_NAMED_CID(NS_SCRIPTSECURITYMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_PRINCIPAL_CID);
 NS_DEFINE_NAMED_CID(NS_SYSTEMPRINCIPAL_CID);
 NS_DEFINE_NAMED_CID(NS_NULLPRINCIPAL_CID);
 NS_DEFINE_NAMED_CID(NS_SECURITYNAMESET_CID);
 NS_DEFINE_NAMED_CID(THIRDPARTYUTIL_CID);
 NS_DEFINE_NAMED_CID(NS_STRUCTUREDCLONECONTAINER_CID);
-NS_DEFINE_NAMED_CID(NS_DEVICE_MOTION_CID);
+NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID);
 
 #ifndef MOZ_WIDGET_GONK
 #if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
 NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
 #endif
 #endif
 NS_DEFINE_NAMED_CID(SMS_SERVICE_CID);
 NS_DEFINE_NAMED_CID(SMS_DATABASE_SERVICE_CID);
@@ -1045,17 +1045,17 @@ static const mozilla::Module::CIDEntry k
   { &kNS_PARENTPROCESSMESSAGEMANAGER_CID, false, NULL, CreateParentMessageManager },
   { &kNS_CHILDPROCESSMESSAGEMANAGER_CID, false, NULL, CreateChildMessageManager },
   { &kNSCHANNELPOLICY_CID, false, NULL, nsChannelPolicyConstructor },
   { &kNS_SCRIPTSECURITYMANAGER_CID, false, NULL, Construct_nsIScriptSecurityManager },
   { &kNS_PRINCIPAL_CID, false, NULL, nsPrincipalConstructor },
   { &kNS_SYSTEMPRINCIPAL_CID, false, NULL, nsSystemPrincipalConstructor },
   { &kNS_NULLPRINCIPAL_CID, false, NULL, nsNullPrincipalConstructor },
   { &kNS_SECURITYNAMESET_CID, false, NULL, nsSecurityNameSetConstructor },
-  { &kNS_DEVICE_MOTION_CID, false, NULL, nsDeviceMotionConstructor },
+  { &kNS_DEVICE_SENSORS_CID, false, NULL, nsDeviceSensorsConstructor },
 #ifndef MOZ_WIDGET_GONK
 #if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
   { &kNS_HAPTICFEEDBACK_CID, false, NULL, nsHapticFeedbackConstructor },
 #endif
 #endif
   { &kTHIRDPARTYUTIL_CID, false, NULL, ThirdPartyUtilConstructor },
   { &kNS_STRUCTUREDCLONECONTAINER_CID, false, NULL, nsStructuredCloneContainerConstructor },
   { &kSMS_SERVICE_CID, false, NULL, nsISmsServiceConstructor },
@@ -1178,17 +1178,17 @@ static const mozilla::Module::ContractID
   { NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_CHILDPROCESSMESSAGEMANAGER_CID },
   { NSCHANNELPOLICY_CONTRACTID, &kNSCHANNELPOLICY_CID },
   { NS_SCRIPTSECURITYMANAGER_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },
   { NS_GLOBAL_CHANNELEVENTSINK_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },
   { NS_PRINCIPAL_CONTRACTID, &kNS_PRINCIPAL_CID },
   { NS_SYSTEMPRINCIPAL_CONTRACTID, &kNS_SYSTEMPRINCIPAL_CID },
   { NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID },
   { NS_SECURITYNAMESET_CONTRACTID, &kNS_SECURITYNAMESET_CID },
-  { NS_DEVICE_MOTION_CONTRACTID, &kNS_DEVICE_MOTION_CID },
+  { NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID },
 #ifndef MOZ_WIDGET_GONK
 #if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
   { "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID },
 #endif
 #endif
   { THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID },
   { NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID },
   { SMS_SERVICE_CONTRACTID, &kSMS_SERVICE_CID },
--- a/xpcom/system/Makefile.in
+++ b/xpcom/system/Makefile.in
@@ -48,17 +48,17 @@ XPIDL_MODULE    = xpcom_system
 XPIDLSRCS = \
         nsIXULAppInfo.idl \
         nsIXULRuntime.idl \
         nsIGConfService.idl \
         nsIGnomeVFSService.idl \
         nsIBlocklistService.idl \
         nsIGIOService.idl \
         nsIGSettingsService.idl \
-        nsIDeviceMotion.idl \
+        nsIDeviceSensors.idl \
         nsIGeolocationProvider.idl \
         nsIHapticFeedback.idl \
         $(NULL)
 
 ifdef MOZ_CRASHREPORTER
 XPIDLSRCS += nsICrashReporter.idl
 endif
 
rename from xpcom/system/nsIDeviceMotion.idl
rename to xpcom/system/nsIDeviceSensors.idl
--- a/xpcom/system/nsIDeviceMotion.idl
+++ b/xpcom/system/nsIDeviceSensors.idl
@@ -34,33 +34,33 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
 interface nsIDOMWindow;
 
 [scriptable, uuid(1B406E32-CF42-471E-A470-6FD600BF4C7B)]
-interface nsIDeviceMotionData : nsISupports
+interface nsIDeviceSensorData : nsISupports
 {
   // Keep in sync with hal/HalSensor.h
   const unsigned long TYPE_ORIENTATION = 0;
   const unsigned long TYPE_ACCELERATION = 1;
   const unsigned long TYPE_PROXIMITY = 2;
   const unsigned long TYPE_LINEAR_ACCELERATION = 3;
   const unsigned long TYPE_GYROSCOPE = 4;
 
   readonly attribute unsigned long type;
 
   readonly attribute double x;
   readonly attribute double y;
   readonly attribute double z;
 };
 
 [scriptable, uuid(b672bfe0-4479-4094-a9ef-1b6847720d07)]
-interface nsIDeviceMotion : nsISupports
+interface nsIDeviceSensors : nsISupports
 {
   // Holds pointers, not AddRef objects -- it is up to the caller
   // to call RemoveWindowListener before the window is deleted.
   [noscript] void addWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
   [noscript] void removeWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
   [noscript] void removeWindowAsListener(in nsIDOMWindow aWindow);
 };