Bug 1594306 - Rename nsGeo* files to match the WebIDL interfaces r=marcosc
authorSid Vishnoi <sidvishnoi8@gmail.com>
Thu, 14 Nov 2019 04:18:04 +0000
changeset 501881 9acbf3949ad78573c5a99452b0fe9db6ff7d0815
parent 501880 e7837d7a78c67fb122f6f4685eb0e2f06841b621
child 501882 97b72aea347c896e1429de4ca15624a12833a46b
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcosc
bugs1594306
milestone72.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 1594306 - Rename nsGeo* files to match the WebIDL interfaces r=marcosc Rename nsGeolocation to Geolocation. Split nsGeoPostion to GeolocationPosition and GeolocationCoordinates. Fix some include guards and comments referencing outdated interfaces. Differential Revision: https://phabricator.services.mozilla.com/D52515
dom/base/Navigator.cpp
dom/bindings/Bindings.conf
dom/geolocation/Geolocation.cpp
dom/geolocation/Geolocation.h
dom/geolocation/GeolocationCoordinates.cpp
dom/geolocation/GeolocationCoordinates.h
dom/geolocation/GeolocationPosition.cpp
dom/geolocation/GeolocationPosition.h
dom/geolocation/GeolocationPositionError.cpp
dom/geolocation/GeolocationPositionError.h
dom/geolocation/MLSFallback.cpp
dom/geolocation/moz.build
dom/geolocation/nsGeoPosition.cpp
dom/geolocation/nsGeoPosition.h
dom/geolocation/nsGeoPositionIPCSerialiser.h
dom/geolocation/nsGeolocation.cpp
dom/geolocation/nsGeolocation.h
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/system/NetworkGeolocationProvider.jsm
dom/system/android/AndroidLocationProvider.cpp
dom/system/linux/GpsdLocationProvider.cpp
dom/system/linux/GpsdLocationProvider.h
dom/system/mac/CoreLocationLocationProvider.h
dom/system/mac/CoreLocationLocationProvider.mm
dom/system/windows/WindowsLocationProvider.cpp
dom/tests/mochitest/geolocation/test_errorcheck.html
dom/tests/unit/test_geolocation_position_unavailable.js
layout/build/components.conf
testing/web-platform/tests/geolocation-API/non-secure-contexts.http.html
widget/android/nsAppShell.cpp
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -11,17 +11,17 @@
 #include "nsIXULAppInfo.h"
 #include "nsPluginArray.h"
 #include "nsMimeTypeArray.h"
 #include "mozilla/AntiTrackingCommon.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/dom/BodyExtractor.h"
 #include "mozilla/dom/FetchBinding.h"
 #include "mozilla/dom/File.h"
-#include "nsGeolocation.h"
+#include "Geolocation.h"
 #include "nsIClassOfService.h"
 #include "nsIHttpProtocolHandler.h"
 #include "nsIContentPolicy.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsContentPolicyUtils.h"
 #include "nsISupportsPriority.h"
 #include "nsICachingChannel.h"
 #include "nsIWebProtocolHandlerRegistrar.h"
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -130,20 +130,16 @@ DOMInterfaces = {
 'ConsoleInstance': {
     'implicitJSContext': ['clear', 'count', 'countReset', 'groupEnd', 'time', 'timeEnd'],
 },
 
 'ConvolverNode': {
     'implicitJSContext': [ 'buffer' ],
 },
 
-'GeolocationCoordinates': {
-    'headerFile': 'nsGeoPosition.h'
-},
-
 'Credential' : {
     'concrete': True,
 },
 
 'Crypto' : {
     'headerFile': 'Crypto.h'
 },
 
@@ -303,20 +299,16 @@ DOMInterfaces = {
 
 'FuzzingFunctions': {
     # The codegen is dumb, and doesn't understand that this interface is only a
     # collection of static methods, so we have this `concrete: False` hack.
     'concrete': False,
     'headerFile': 'mozilla/dom/FuzzingFunctions.h',
 },
 
-'Geolocation': {
-    'headerFile': 'nsGeolocation.h'
-},
-
 'HeapSnapshot': {
     'nativeType': 'mozilla::devtools::HeapSnapshot'
 },
 
 'History': {
     'headerFile': 'nsHistory.h',
     'nativeType': 'nsHistory'
 },
@@ -632,20 +624,16 @@ DOMInterfaces = {
 'PluginTag': {
     'nativeType': 'nsIPluginTag',
 },
 
 'Policy': {
     'nativeType': 'mozilla::dom::FeaturePolicy',
 },
 
-'GeolocationPosition': {
-    'headerFile': 'nsGeoPosition.h'
-},
-
 'PromiseNativeHandler': {
     'wrapperCache': False,
 },
 
 'PushEvent': {
     'headerFile': 'ServiceWorkerEvents.h',
 },
 
rename from dom/geolocation/nsGeolocation.cpp
rename to dom/geolocation/Geolocation.cpp
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/Geolocation.cpp
@@ -1,15 +1,15 @@
 /* -*- 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 "nsGeolocation.h"
+#include "Geolocation.h"
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/CycleCollectedJSContext.h"  // for nsAutoMicroTask
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/FeaturePolicyUtils.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/GeolocationPositionError.h"
 #include "mozilla/dom/GeolocationPositionErrorBinding.h"
rename from dom/geolocation/nsGeolocation.h
rename to dom/geolocation/Geolocation.h
--- a/dom/geolocation/nsGeolocation.h
+++ b/dom/geolocation/Geolocation.h
@@ -1,31 +1,32 @@
 /* -*- 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/. */
 
-#ifndef nsGeoLocation_h
-#define nsGeoLocation_h
+#ifndef mozilla_dom_Geolocation_h
+#define mozilla_dom_Geolocation_h
 
 // Microsoft's API Name hackery sucks
 #undef CreateEvent
 
 #include "mozilla/StaticPtr.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "nsITimer.h"
 #include "nsIObserver.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsWrapperCache.h"
 
 #include "nsCycleCollectionParticipant.h"
 
-#include "nsGeoPosition.h"
+#include "GeolocationPosition.h"
+#include "GeolocationCoordinates.h"
 #include "nsIDOMGeoPosition.h"
 #include "nsIDOMGeoPositionCallback.h"
 #include "nsIDOMGeoPositionErrorCallback.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/GeolocationBinding.h"
 #include "mozilla/dom/CallbackObject.h"
 
 #include "nsIGeolocationProvider.h"
@@ -243,9 +244,9 @@ class Geolocation final : public nsIGeol
 
   // Our cached non-window singleton.
   static mozilla::StaticRefPtr<Geolocation> sNonWindowSingleton;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
-#endif /* nsGeoLocation_h */
+#endif /* mozilla_dom_Geolocation_h */
new file mode 100644
--- /dev/null
+++ b/dom/geolocation/GeolocationCoordinates.cpp
@@ -0,0 +1,69 @@
+/* -*- 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 "mozilla/dom/GeolocationCoordinates.h"
+
+#include "mozilla/FloatingPoint.h"
+#include "mozilla/dom/GeolocationPositionBinding.h"
+#include "mozilla/dom/GeolocationCoordinatesBinding.h"
+
+namespace mozilla {
+namespace dom {
+
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GeolocationCoordinates, mPosition)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(GeolocationCoordinates)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(GeolocationCoordinates)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GeolocationCoordinates)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
+NS_INTERFACE_MAP_END
+
+GeolocationCoordinates::GeolocationCoordinates(GeolocationPosition* aPosition,
+                                               nsIDOMGeoPositionCoords* aCoords)
+    : mPosition(aPosition), mCoords(aCoords) {}
+
+GeolocationCoordinates::~GeolocationCoordinates() {}
+
+GeolocationPosition* GeolocationCoordinates::GetParentObject() const {
+  return mPosition;
+}
+
+JSObject* GeolocationCoordinates::WrapObject(
+    JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
+  return GeolocationCoordinates_Binding::Wrap(aCx, this, aGivenProto);
+}
+
+#define GENERATE_COORDS_WRAPPED_GETTER(name)    \
+  double GeolocationCoordinates::name() const { \
+    double rv;                                  \
+    mCoords->Get##name(&rv);                    \
+    return rv;                                  \
+  }
+
+#define GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(name)          \
+  Nullable<double> GeolocationCoordinates::Get##name() const { \
+    double value;                                              \
+    mCoords->Get##name(&value);                                \
+    Nullable<double> rv;                                       \
+    if (!IsNaN(value)) {                                       \
+      rv.SetValue(value);                                      \
+    }                                                          \
+    return rv;                                                 \
+  }
+
+GENERATE_COORDS_WRAPPED_GETTER(Latitude)
+GENERATE_COORDS_WRAPPED_GETTER(Longitude)
+GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(Altitude)
+GENERATE_COORDS_WRAPPED_GETTER(Accuracy)
+GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(AltitudeAccuracy)
+GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(Heading)
+GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(Speed)
+
+#undef GENERATE_COORDS_WRAPPED_GETTER
+#undef GENERATE_COORDS_WRAPPED_GETTER_NULLABLE
+
+}  // namespace dom
+}  // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/dom/geolocation/GeolocationCoordinates.h
@@ -0,0 +1,58 @@
+/* -*- 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/. */
+
+#ifndef mozilla_dom_GeolocationCoordinates_h
+#define mozilla_dom_GeolocationCoordinates_h
+
+#include "nsIDOMGeoPositionCoords.h"
+#include "GeolocationPosition.h"
+#include "nsCycleCollectionParticipant.h"
+#include "nsWrapperCache.h"
+#include "mozilla/dom/Nullable.h"
+#include "js/TypeDecls.h"
+
+namespace mozilla {
+namespace dom {
+
+class GeolocationCoordinates final : public nsISupports, public nsWrapperCache {
+  ~GeolocationCoordinates();
+
+ public:
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GeolocationCoordinates)
+
+ public:
+  GeolocationCoordinates(GeolocationPosition* aPosition,
+                         nsIDOMGeoPositionCoords* aCoords);
+
+  GeolocationPosition* GetParentObject() const;
+
+  virtual JSObject* WrapObject(JSContext* aCx,
+                               JS::Handle<JSObject*> aGivenProto) override;
+
+  double Latitude() const;
+
+  double Longitude() const;
+
+  Nullable<double> GetAltitude() const;
+
+  double Accuracy() const;
+
+  Nullable<double> GetAltitudeAccuracy() const;
+
+  Nullable<double> GetHeading() const;
+
+  Nullable<double> GetSpeed() const;
+
+ private:
+  RefPtr<GeolocationPosition> mPosition;
+  nsCOMPtr<nsIDOMGeoPositionCoords> mCoords;
+};
+
+}  // namespace dom
+}  // namespace mozilla
+
+#endif /* mozilla_dom_GeolocationCoordinates_h */
rename from dom/geolocation/nsGeoPosition.cpp
rename to dom/geolocation/GeolocationPosition.cpp
--- a/dom/geolocation/nsGeoPosition.cpp
+++ b/dom/geolocation/GeolocationPosition.cpp
@@ -1,15 +1,16 @@
 /* -*- 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 "nsGeoPosition.h"
+#include "mozilla/dom/GeolocationPosition.h"
+#include "mozilla/dom/GeolocationCoordinates.h"
 
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/dom/GeolocationPositionBinding.h"
 #include "mozilla/dom/GeolocationCoordinatesBinding.h"
 
 using mozilla::EqualOrBothNaN;
 using mozilla::IsNaN;
 
@@ -180,62 +181,10 @@ GeolocationCoordinates* GeolocationPosit
 
 uint64_t GeolocationPosition::Timestamp() const {
   uint64_t rv;
 
   mGeoPosition->GetTimestamp(&rv);
   return rv;
 }
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GeolocationCoordinates, mPosition)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(GeolocationCoordinates)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(GeolocationCoordinates)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GeolocationCoordinates)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-GeolocationCoordinates::GeolocationCoordinates(GeolocationPosition* aPosition,
-                                               nsIDOMGeoPositionCoords* aCoords)
-    : mPosition(aPosition), mCoords(aCoords) {}
-
-GeolocationCoordinates::~GeolocationCoordinates() {}
-
-GeolocationPosition* GeolocationCoordinates::GetParentObject() const {
-  return mPosition;
-}
-
-JSObject* GeolocationCoordinates::WrapObject(
-    JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
-  return GeolocationCoordinates_Binding::Wrap(aCx, this, aGivenProto);
-}
-
-#define GENERATE_COORDS_WRAPPED_GETTER(name)    \
-  double GeolocationCoordinates::name() const { \
-    double rv;                                  \
-    mCoords->Get##name(&rv);                    \
-    return rv;                                  \
-  }
-
-#define GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(name)          \
-  Nullable<double> GeolocationCoordinates::Get##name() const { \
-    double value;                                              \
-    mCoords->Get##name(&value);                                \
-    Nullable<double> rv;                                       \
-    if (!IsNaN(value)) {                                       \
-      rv.SetValue(value);                                      \
-    }                                                          \
-    return rv;                                                 \
-  }
-
-GENERATE_COORDS_WRAPPED_GETTER(Latitude)
-GENERATE_COORDS_WRAPPED_GETTER(Longitude)
-GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(Altitude)
-GENERATE_COORDS_WRAPPED_GETTER(Accuracy)
-GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(AltitudeAccuracy)
-GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(Heading)
-GENERATE_COORDS_WRAPPED_GETTER_NULLABLE(Speed)
-
-#undef GENERATE_COORDS_WRAPPED_GETTER
-#undef GENERATE_COORDS_WRAPPED_GETTER_NULLABLE
-
 }  // namespace dom
 }  // namespace mozilla
rename from dom/geolocation/nsGeoPosition.h
rename to dom/geolocation/GeolocationPosition.h
--- a/dom/geolocation/nsGeoPosition.h
+++ b/dom/geolocation/GeolocationPosition.h
@@ -1,20 +1,21 @@
 /* -*- 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/. */
 
-#ifndef nsGeoPosition_h
-#define nsGeoPosition_h
+#ifndef mozilla_dom_GeolocationPosition_h
+#define mozilla_dom_GeolocationPosition_h
 
 #include "nsIDOMGeoPositionCoords.h"
 #include "nsIDOMGeoPosition.h"
 #include "nsString.h"
+#include "nsCOMPtr.h"
 #include "mozilla/Attributes.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "mozilla/dom/Nullable.h"
 #include "js/TypeDecls.h"
 
 ////////////////////////////////////////////////////
 // nsGeoPositionCoords
@@ -88,47 +89,12 @@ class GeolocationPosition final : public
   nsIDOMGeoPosition* GetWrappedGeoPosition() { return mGeoPosition; }
 
  private:
   RefPtr<GeolocationCoordinates> mCoordinates;
   nsCOMPtr<nsISupports> mParent;
   nsCOMPtr<nsIDOMGeoPosition> mGeoPosition;
 };
 
-class GeolocationCoordinates final : public nsISupports, public nsWrapperCache {
-  ~GeolocationCoordinates();
-
- public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GeolocationCoordinates)
-
- public:
-  GeolocationCoordinates(GeolocationPosition* aPosition,
-                         nsIDOMGeoPositionCoords* aCoords);
-
-  GeolocationPosition* GetParentObject() const;
-
-  virtual JSObject* WrapObject(JSContext* aCx,
-                               JS::Handle<JSObject*> aGivenProto) override;
-
-  double Latitude() const;
-
-  double Longitude() const;
-
-  Nullable<double> GetAltitude() const;
-
-  double Accuracy() const;
-
-  Nullable<double> GetAltitudeAccuracy() const;
-
-  Nullable<double> GetHeading() const;
-
-  Nullable<double> GetSpeed() const;
-
- private:
-  RefPtr<GeolocationPosition> mPosition;
-  nsCOMPtr<nsIDOMGeoPositionCoords> mCoords;
-};
-
 }  // namespace dom
 }  // namespace mozilla
 
-#endif /* nsGeoPosition_h */
+#endif /* mozilla_dom_GeolocationPosition_h */
--- a/dom/geolocation/GeolocationPositionError.cpp
+++ b/dom/geolocation/GeolocationPositionError.cpp
@@ -2,17 +2,17 @@
 /* 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 "mozilla/dom/GeolocationPositionError.h"
 #include "mozilla/dom/GeolocationPositionErrorBinding.h"
 #include "mozilla/CycleCollectedJSContext.h"  // for nsAutoMicroTask
-#include "nsGeolocation.h"
+#include "Geolocation.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GeolocationPositionError, mParent)
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(GeolocationPositionError, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(GeolocationPositionError, Release)
 
--- a/dom/geolocation/GeolocationPositionError.h
+++ b/dom/geolocation/GeolocationPositionError.h
@@ -1,16 +1,16 @@
 /* -*- 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/. */
 
-#ifndef mozilla_dom_PositionError_h
-#define mozilla_dom_PositionError_h
+#ifndef mozilla_dom_GeolocationPositionError_h
+#define mozilla_dom_GeolocationPositionError_h
 
 #include "nsWrapperCache.h"
 #include "nsISupportsImpl.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/dom/CallbackObject.h"
 
 class nsIDOMGeoPositionErrorCallback;
 
@@ -45,9 +45,9 @@ class GeolocationPositionError final : p
   ~GeolocationPositionError();
   int16_t mCode;
   RefPtr<Geolocation> mParent;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
-#endif /* mozilla_dom_PositionError_h */
+#endif /* mozilla_dom_GeolocationPositionError_h */
--- a/dom/geolocation/MLSFallback.cpp
+++ b/dom/geolocation/MLSFallback.cpp
@@ -1,16 +1,16 @@
 /* -*- 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 "MLSFallback.h"
-#include "nsGeoPosition.h"
+#include "GeolocationPosition.h"
 #include "nsIGeolocationProvider.h"
 #include "nsServiceManagerUtils.h"
 
 NS_IMPL_ISUPPORTS(MLSFallback, nsITimerCallback, nsINamed)
 
 MLSFallback::MLSFallback(uint32_t delay) : mDelayMs(delay) {}
 
 MLSFallback::~MLSFallback() {}
--- a/dom/geolocation/moz.build
+++ b/dom/geolocation/moz.build
@@ -3,32 +3,35 @@
 # 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/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM: Geolocation")
 
 EXPORTS += [
-    'nsGeoPosition.h',
     'nsGeoPositionIPCSerialiser.h',
 ]
 
 EXPORTS.mozilla.dom += [
+    'Geolocation.h',
+    'GeolocationCoordinates.h',
+    'GeolocationPosition.h',
     'GeolocationPositionError.h',
 ]
 
 SOURCES += [
+    'Geolocation.cpp',
+    'GeolocationCoordinates.cpp',
+    'GeolocationPosition.cpp',
     'GeolocationPositionError.cpp',
-    'nsGeolocation.cpp',
 ]
 
 UNIFIED_SOURCES += [
     'MLSFallback.cpp',
-    'nsGeoPosition.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/ipc',
--- a/dom/geolocation/nsGeoPositionIPCSerialiser.h
+++ b/dom/geolocation/nsGeoPositionIPCSerialiser.h
@@ -3,17 +3,17 @@
 /* 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 dom_src_geolocation_IPC_serialiser
 #define dom_src_geolocation_IPC_serialiser
 
 #include "ipc/IPCMessageUtils.h"
-#include "nsGeoPosition.h"
+#include "mozilla/dom/GeolocationPosition.h"
 #include "nsIDOMGeoPosition.h"
 
 namespace IPC {
 
 template <>
 struct ParamTraits<nsIDOMGeoPositionCoords*> {
   // Function to serialize a geoposition
   static void Write(Message* aMsg, nsIDOMGeoPositionCoords* aParam) {
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -105,17 +105,17 @@
 #include "nsIChildProcessChannelListener.h"
 #include "mozilla/net/HttpChannelChild.h"
 #include "nsQueryObject.h"
 #include "imgLoader.h"
 #include "GMPServiceChild.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIStringBundle.h"
 #include "nsIWorkerDebuggerManager.h"
-#include "nsGeolocation.h"
+#include "Geolocation.h"
 #include "audio_thread_priority.h"
 #include "nsIConsoleService.h"
 #include "audio_thread_priority.h"
 
 #if !defined(XP_WIN)
 #  include "mozilla/Omnijar.h"
 #endif
 
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -146,17 +146,17 @@
 #include "nsIClipboard.h"
 #include "nsICookie.h"
 #include "nsContentPermissionHelper.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsIContentProcess.h"
 #include "nsICycleCollectorListener.h"
 #include "nsIDocShellTreeOwner.h"
 #include "mozilla/dom/Document.h"
-#include "nsGeolocation.h"
+#include "Geolocation.h"
 #include "nsIDragService.h"
 #include "mozilla/dom/WakeLock.h"
 #include "nsIExternalProtocolService.h"
 #include "nsIGfxInfo.h"
 #include "nsIIdleService.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsILocalStorageManager.h"
 #include "nsIMemoryInfoDumper.h"
--- a/dom/system/NetworkGeolocationProvider.jsm
+++ b/dom/system/NetworkGeolocationProvider.jsm
@@ -6,17 +6,17 @@
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["XMLHttpRequest"]);
 
-// PositionError has no interface object, so we can't use that here.
+// GeolocationPositionError has no interface object, so we can't use that here.
 const POSITION_UNAVAILABLE = 2;
 
 var gLoggingEnabled = false;
 
 /*
    The gLocationRequestTimeout controls how long we wait on receiving an update
    from the Wifi subsystem.  If this timer fires, we believe the Wifi scan has
    had a problem and we no longer can use Wifi to position the user this time
--- a/dom/system/android/AndroidLocationProvider.cpp
+++ b/dom/system/android/AndroidLocationProvider.cpp
@@ -1,16 +1,16 @@
 /* -*- 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 "nsGeolocation.h"
-#include "nsGeoPosition.h"
+#include "Geolocation.h"
+#include "GeolocationPosition.h"
 #include "AndroidLocationProvider.h"
 #include "GeneratedJNIWrappers.h"
 
 using namespace mozilla;
 
 extern nsIGeolocationUpdate* gLocationCallback;
 
 NS_IMPL_ISUPPORTS(AndroidLocationProvider, nsIGeolocationProvider)
--- a/dom/system/linux/GpsdLocationProvider.cpp
+++ b/dom/system/linux/GpsdLocationProvider.cpp
@@ -7,17 +7,17 @@
 #include "GpsdLocationProvider.h"
 #include <errno.h>
 #include <gps.h>
 #include "MLSFallback.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/LazyIdleThread.h"
 #include "mozilla/dom/GeolocationPositionErrorBinding.h"
-#include "nsGeoPosition.h"
+#include "GeolocationPosition.h"
 #include "nsProxyRelease.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 namespace dom {
 
 //
 // MLSGeolocationUpdate
--- a/dom/system/linux/GpsdLocationProvider.h
+++ b/dom/system/linux/GpsdLocationProvider.h
@@ -3,17 +3,17 @@
 /* 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 GpsdLocationProvider_h
 #define GpsdLocationProvider_h
 
 #include "nsCOMPtr.h"
-#include "nsGeolocation.h"
+#include "Geolocation.h"
 #include "nsIGeolocationProvider.h"
 
 class MLSFallback;
 
 namespace mozilla {
 
 class LazyIdleThread;
 
--- a/dom/system/mac/CoreLocationLocationProvider.h
+++ b/dom/system/mac/CoreLocationLocationProvider.h
@@ -15,17 +15,17 @@
  * Declaring them directly in CoreLocationLocationProvider
  * would require Objective-C++ syntax, which would contaminate all
  * files that include this header and require them to be Objective-C++
  * as well.
  *
  * The solution then is to forward-declare CoreLocationObjects here and
  * hold a pointer to it in CoreLocationLocationProvider, and only actually
  * define it in CoreLocationLocationProvider.mm, thus making it safe
- * for nsGeolocation.cpp, which is C++-only, to include this header.
+ * for Geolocation.cpp, which is C++-only, to include this header.
  */
 class CoreLocationObjects;
 class MLSFallback;
 
 class CoreLocationLocationProvider : public nsIGeolocationProvider {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIGEOLOCATIONPROVIDER
--- a/dom/system/mac/CoreLocationLocationProvider.mm
+++ b/dom/system/mac/CoreLocationLocationProvider.mm
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 "nsAutoPtr.h"
 #include "nsCOMPtr.h"
-#include "nsGeoPosition.h"
+#include "GeolocationPosition.h"
 #include "nsIConsoleService.h"
 #include "nsServiceManagerUtils.h"
 #include "CoreLocationLocationProvider.h"
 #include "nsCocoaFeatures.h"
 #include "prtime.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/GeolocationPositionErrorBinding.h"
--- a/dom/system/windows/WindowsLocationProvider.cpp
+++ b/dom/system/windows/WindowsLocationProvider.cpp
@@ -1,16 +1,16 @@
 /* -*- 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 "WindowsLocationProvider.h"
-#include "nsGeoPosition.h"
+#include "GeolocationPosition.h"
 #include "nsComponentManagerUtils.h"
 #include "prtime.h"
 #include "MLSFallback.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/GeolocationPositionErrorBinding.h"
 
--- a/dom/tests/mochitest/geolocation/test_errorcheck.html
+++ b/dom/tests/mochitest/geolocation/test_errorcheck.html
@@ -9,33 +9,33 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="geolocation_common.js"></script>
 
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=684722">Mozilla Bug 684722</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
 resume_geolocationProvider(function() {
   force_prompt(true, test1);
 });
 
 function test1() {
     send404_geolocationProvider(test2);
 }
 
 function errorCallback(error) {
-    // PositionError has no interface object, so we can't get constants off that.
+    // GeolocationPositionError has no interface object, so we can't get constants off that.
     is(error.code, error.POSITION_UNAVAILABLE,
        "Geolocation error handler fired");
     is(error.POSITION_UNAVAILABLE, 2,
        "Value of POSITION_UNAVAILABLE should be correct");
     SimpleTest.finish();
 }
 
 function successCallback(position) {
--- a/dom/tests/unit/test_geolocation_position_unavailable.js
+++ b/dom/tests/unit/test_geolocation_position_unavailable.js
@@ -1,17 +1,17 @@
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function successCallback() {
   Assert.ok(false);
   do_test_finished();
 }
 
 function errorCallback(err) {
-  // PositionError has no interface object, so we can't get constants off that.
+  // GeolocationPositionError has no interface object, so we can't get constants off that.
   Assert.equal(err.POSITION_UNAVAILABLE, err.code);
   Assert.equal(2, err.code);
   do_test_finished();
 }
 
 function run_test() {
   do_test_pending();
 
--- a/layout/build/components.conf
+++ b/layout/build/components.conf
@@ -214,17 +214,17 @@ Classes = [
         'headers': ['GMPService.h'],
         'constructor': 'mozilla::gmp::GeckoMediaPluginService::GetGeckoMediaPluginService',
     },
     {
         'cid': '{01e1c3ff-094a-d048-44b4-62d29c7b4f39}',
         'contract_ids': ['@mozilla.org/geolocation;1'],
         'singleton': True,
         'type': 'mozilla::dom::Geolocation',
-        'headers': ['/dom/geolocation/nsGeolocation.h'],
+        'headers': ['/dom/geolocation/Geolocation.h'],
         'constructor': 'mozilla::dom::Geolocation::NonWindowSingleton',
     },
     {
         'cid': '{130b016f-fad7-4526-bc7f-827dabf79265}',
         'contract_ids': ['@mozilla.org/globalmessagemanager;1'],
         'legacy_constructor': 'CreateGlobalMessageManager',
     },
     {
--- a/testing/web-platform/tests/geolocation-API/non-secure-contexts.http.html
+++ b/testing/web-platform/tests/geolocation-API/non-secure-contexts.http.html
@@ -52,17 +52,17 @@
       navigator.geolocation.getCurrentPosition(successCallback, errorCallBack);
     });
     const positionError = await positionErrorPromise;
     assert_equals(
       positionError.code,
       1,
       "Expected the value for PERMISSION_DENIED, which is 1."
     );
-  }, "When in a non-secure context, the getCurrentPosition() errorCallBack gets a PositionError with the correct error code.");
+  }, "When in a non-secure context, the getCurrentPosition() errorCallBack gets a GeolocationPositionError with the correct error code.");
 
   promise_test(async () => {
     const positionErrorPromise = new Promise(errorCallBack => {
       const successCallback = () => {
         assert_unreached(
           "successCallback must never be invoked in non-secure contexts."
         );
       };
@@ -73,10 +73,10 @@
       assert_true(Number.isInteger(id), "Must return an identifier.");
     });
     const positionError = await positionErrorPromise;
     assert_equals(
       positionError.code,
       1,
       "Expected the value for PERMISSION_DENIED, which is 1."
     );
-  }, "When in a non-secure context, the watchPosition() errorCallBack gets a PositionError with the correct error code.");
+  }, "When in a non-secure context, the watchPosition() errorCallBack gets a GeolocationPositionError with the correct error code.");
 </script>
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -19,17 +19,17 @@
 #include "nsIGeolocationProvider.h"
 #include "nsCacheService.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMWakeLockListener.h"
 #include "nsIPowerManagerService.h"
 #include "nsISpeculativeConnect.h"
 #include "nsIURIFixup.h"
 #include "nsCategoryManagerUtils.h"
-#include "nsGeoPosition.h"
+#include "mozilla/dom/GeolocationPosition.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Components.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Hal.h"
 #include "mozilla/dom/BrowserChild.h"