Bug 1317706 - Remove Pose WebIDL for sharing the implementation to Pose class. r=bz, a=jcristau
authorDaosheng Mu <daoshengmu@gmail.com>
Thu, 17 Nov 2016 07:11:00 -0500
changeset 353700 970562d09078d50c968a06471184fc9f7e330a38
parent 353699 c0dc7ffce4ba6a5bb3544b5ecccd536fd89fdbed
child 353701 42afdb8f7e6b3e8a465042f64c6c49782f231af4
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, jcristau
bugs1317706
milestone52.0a2
Bug 1317706 - Remove Pose WebIDL for sharing the implementation to Pose class. r=bz, a=jcristau MozReview-Commit-ID: Lvu0AOBi5Ti
dom/base/Pose.cpp
dom/base/Pose.h
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/GamepadPose.webidl
dom/webidl/Pose.webidl
dom/webidl/VRDisplay.webidl
dom/webidl/moz.build
--- a/dom/base/Pose.cpp
+++ b/dom/base/Pose.cpp
@@ -1,17 +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 "mozilla/HoldDropJSObjects.h"
 #include "mozilla/dom/TypedArray.h"
-#include "mozilla/dom/PoseBinding.h"
 #include "mozilla/dom/Pose.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(Pose)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Pose)
@@ -79,16 +78,10 @@ Pose::SetFloat32Array(JSContext* aJSCont
       aRv.NoteJSContextException(aJSContext);
       return;
     }
   }
 
   aRetVal.set(aObj);
 }
 
-/* virtual */ JSObject*
-Pose::WrapObject(JSContext* aJSContext, JS::Handle<JSObject*> aGivenProto)
-{
-  return PoseBinding::Wrap(aJSContext, this, aGivenProto);
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/Pose.h
+++ b/dom/base/Pose.h
@@ -36,19 +36,16 @@ public:
                               ErrorResult& aRv) = 0;
   virtual void GetAngularVelocity(JSContext* aJSContext,
                                   JS::MutableHandle<JSObject*> aRetval,
                                   ErrorResult& aRv) = 0;
   virtual void GetAngularAcceleration(JSContext* aJSContext,
                                       JS::MutableHandle<JSObject*> aRetval,
                                       ErrorResult& aRv) = 0;
 
-  virtual JSObject* WrapObject(JSContext* aJSContext,
-                               JS::Handle<JSObject*> aGivenProto) override;
-
 protected:
   virtual ~Pose();
 
   void SetFloat32Array(JSContext* aJSContext, JS::MutableHandle<JSObject*> aRetVal,
                        JS::Heap<JSObject*>& aObj, float* aVal, uint32_t sizeOfVal,
                        bool bCreate, ErrorResult& aRv);
 
   nsCOMPtr<nsISupports> mParent;
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -772,18 +772,16 @@ var interfaceNamesInGlobalScope =
     {name: "PointerEvent", nightly: true, desktop: true, disabled: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "PopStateEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "PopupBlockedEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "PopupBoxObject", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "Pose", release: false},
-// IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "PresentationDeviceInfoManager",
      disabled: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "Presentation", disabled: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "PresentationAvailability", disabled: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "PresentationConnection", disabled: true},
--- a/dom/webidl/GamepadPose.webidl
+++ b/dom/webidl/GamepadPose.webidl
@@ -1,13 +1,27 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Pref="dom.gamepad.extensions.enabled",
-  HeaderFile="mozilla/dom/GamepadPose.h"]
-interface GamepadPose : Pose
+[Pref="dom.gamepad.extensions.enabled"]
+interface GamepadPose
 {
   readonly attribute boolean hasOrientation;
   readonly attribute boolean hasPosition;
+
+  /**
+   * position, linearVelocity, and linearAcceleration are 3-component vectors.
+   * position is relative to a sitting space. Transforming this point with
+   * VRStageParameters.sittingToStandingTransform converts this to standing space.
+   */
+  [Constant, Throws] readonly attribute Float32Array? position;
+  [Constant, Throws] readonly attribute Float32Array? linearVelocity;
+  [Constant, Throws] readonly attribute Float32Array? linearAcceleration;
+
+  /* orientation is a 4-entry array representing the components of a quaternion. */
+  [Constant, Throws] readonly attribute Float32Array? orientation;
+  /* angularVelocity and angularAcceleration are the components of 3-dimensional vectors. */
+  [Constant, Throws] readonly attribute Float32Array? angularVelocity;
+  [Constant, Throws] readonly attribute Float32Array? angularAcceleration;
 };
deleted file mode 100644
--- a/dom/webidl/Pose.webidl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/.
- */
-
-interface Pose
-{
-  /**
-   * position, linearVelocity, and linearAcceleration are 3-component vectors.
-   * position is relative to a sitting space. Transforming this point with
-   * VRStageParameters.sittingToStandingTransform converts this to standing space.
-   */
-  [Constant, Throws] readonly attribute Float32Array? position;
-  [Constant, Throws] readonly attribute Float32Array? linearVelocity;
-  [Constant, Throws] readonly attribute Float32Array? linearAcceleration;
-
-  /* orientation is a 4-entry array representing the components of a quaternion. */
-  [Constant, Throws] readonly attribute Float32Array? orientation;
-  /* angularVelocity and angularAcceleration are the components of 3-dimensional vectors. */
-  [Constant, Throws] readonly attribute Float32Array? angularVelocity;
-  [Constant, Throws] readonly attribute Float32Array? angularAcceleration;
-};
--- a/dom/webidl/VRDisplay.webidl
+++ b/dom/webidl/VRDisplay.webidl
@@ -111,19 +111,32 @@ interface VRStageParameters {
    * this rectangle.
    */
   readonly attribute float sizeX;
   readonly attribute float sizeZ;
 };
 
 [Pref="dom.vr.enabled",
  HeaderFile="mozilla/dom/VRDisplay.h"]
-interface VRPose : Pose
+interface VRPose
 {
+  /**
+   * position, linearVelocity, and linearAcceleration are 3-component vectors.
+   * position is relative to a sitting space. Transforming this point with
+   * VRStageParameters.sittingToStandingTransform converts this to standing space.
+   */
+  [Constant, Throws] readonly attribute Float32Array? position;
+  [Constant, Throws] readonly attribute Float32Array? linearVelocity;
+  [Constant, Throws] readonly attribute Float32Array? linearAcceleration;
 
+  /* orientation is a 4-entry array representing the components of a quaternion. */
+  [Constant, Throws] readonly attribute Float32Array? orientation;
+  /* angularVelocity and angularAcceleration are the components of 3-dimensional vectors. */
+  [Constant, Throws] readonly attribute Float32Array? angularVelocity;
+  [Constant, Throws] readonly attribute Float32Array? angularAcceleration;
 };
 
 [Constructor,
  Pref="dom.vr.enabled",
  HeaderFile="mozilla/dom/VRDisplay.h"]
 interface VRFrameData {
   readonly attribute DOMHighResTimeStamp timestamp;
 
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -357,17 +357,16 @@ WEBIDL_FILES = [
     'PeriodicWave.webidl',
     'Permissions.webidl',
     'PermissionSettings.webidl',
     'PermissionStatus.webidl',
     'Plugin.webidl',
     'PluginArray.webidl',
     'PointerEvent.webidl',
     'PopupBoxObject.webidl',
-    'Pose.webidl',
     'Position.webidl',
     'PositionError.webidl',
     'Presentation.webidl',
     'PresentationAvailability.webidl',
     'PresentationConnection.webidl',
     'PresentationConnectionList.webidl',
     'PresentationDeviceInfoManager.webidl',
     'PresentationReceiver.webidl',