Bug 1004588 - remove deprecated and unused ICameraControl::Size attributes, r=bz
authorMike Habicher <mikeh@mozilla.com>
Thu, 05 Jun 2014 11:21:02 -0400
changeset 207216 4cffd9f9279181e1f4467f532b2c1f494de5d4ab
parent 207215 0702cd2357047b0fe42017ce24aac7e0e7674c56
child 207217 27214c24a0c3fad5674302de1c3c6299d469a670
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1004588
milestone32.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 1004588 - remove deprecated and unused ICameraControl::Size attributes, r=bz
dom/camera/DOMCameraControl.cpp
dom/camera/DOMCameraControl.h
dom/webidl/CameraControl.webidl
--- a/dom/camera/DOMCameraControl.cpp
+++ b/dom/camera/DOMCameraControl.cpp
@@ -419,126 +419,49 @@ nsDOMCameraControl::GetFocusAreas(nsTArr
 }
 void
 nsDOMCameraControl::SetFocusAreas(const Optional<Sequence<CameraRegion> >& aFocusAreas, ErrorResult& aRv)
 {
   aRv = Set(CAMERA_PARAM_FOCUSAREAS, aFocusAreas,
             mCurrentConfiguration->mMaxFocusAreas);
 }
 
-static nsresult
-GetSize(JSContext* aCx, JS::Value* aValue, const ICameraControl::Size& aSize)
-{
-  JS::Rooted<JSObject*> o(aCx, JS_NewObject(aCx, nullptr, JS::NullPtr(), JS::NullPtr()));
-  if (!o) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  JS::Rooted<JS::Value> v(aCx);
-
-  v = INT_TO_JSVAL(aSize.width);
-  if (!JS_SetProperty(aCx, o, "width", v)) {
-    return NS_ERROR_FAILURE;
-  }
-  v = INT_TO_JSVAL(aSize.height);
-  if (!JS_SetProperty(aCx, o, "height", v)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  *aValue = JS::ObjectValue(*o);
-  return NS_OK;
-}
-
-/* attribute any pictureSize, deprecated */
-JS::Value
-nsDOMCameraControl::GetPictureSize(JSContext* cx, ErrorResult& aRv)
-{
-  JS::Rooted<JS::Value> value(cx);
-
-  ICameraControl::Size size;
-  aRv = mCameraControl->Get(CAMERA_PARAM_PICTURE_SIZE, size);
-  if (aRv.Failed()) {
-    return value;
-  }
-
-  aRv = GetSize(cx, value.address(), size);
-  return value;
-}
-void
-nsDOMCameraControl::SetPictureSize(JSContext* aCx, JS::Handle<JS::Value> aSize, ErrorResult& aRv)
-{
-  CameraSize size;
-  if (!size.Init(aCx, aSize)) {
-    aRv = NS_ERROR_FAILURE;
-    return;
-  }
-
-  ICameraControl::Size s = { size.mWidth, size.mHeight };
-  aRv = mCameraControl->Set(CAMERA_PARAM_PICTURE_SIZE, s);
-}
-
 void
 nsDOMCameraControl::GetPictureSize(CameraSize& aSize, ErrorResult& aRv)
 {
   ICameraControl::Size size;
   aRv = mCameraControl->Get(CAMERA_PARAM_PICTURE_SIZE, size);
   if (aRv.Failed()) {
     return;
   }
 
   aSize.mWidth = size.width;
   aSize.mHeight = size.height;
 }
+
 void
 nsDOMCameraControl::SetPictureSize(const CameraSize& aSize, ErrorResult& aRv)
 {
   ICameraControl::Size s = { aSize.mWidth, aSize.mHeight };
   aRv = mCameraControl->Set(CAMERA_PARAM_PICTURE_SIZE, s);
 }
 
-/* attribute any thumbnailSize, deprecated */
-JS::Value
-nsDOMCameraControl::GetThumbnailSize(JSContext* aCx, ErrorResult& aRv)
-{
-  JS::Rooted<JS::Value> value(aCx);
-
-  ICameraControl::Size size;
-  aRv = mCameraControl->Get(CAMERA_PARAM_THUMBNAILSIZE, size);
-  if (aRv.Failed()) {
-    return value;
-  }
-
-  aRv = GetSize(aCx, value.address(), size);
-  return value;
-}
-void
-nsDOMCameraControl::SetThumbnailSize(JSContext* aCx, JS::Handle<JS::Value> aSize, ErrorResult& aRv)
-{
-  CameraSize size;
-  if (!size.Init(aCx, aSize)) {
-    aRv = NS_ERROR_FAILURE;
-    return;
-  }
-
-  ICameraControl::Size s = { size.mWidth, size.mHeight };
-  aRv = mCameraControl->Set(CAMERA_PARAM_THUMBNAILSIZE, s);
-}
-
 void
 nsDOMCameraControl::GetThumbnailSize(CameraSize& aSize, ErrorResult& aRv)
 {
   ICameraControl::Size size;
   aRv = mCameraControl->Get(CAMERA_PARAM_THUMBNAILSIZE, size);
   if (aRv.Failed()) {
     return;
   }
 
   aSize.mWidth = size.width;
   aSize.mHeight = size.height;
 }
+
 void
 nsDOMCameraControl::SetThumbnailSize(const CameraSize& aSize, ErrorResult& aRv)
 {
   ICameraControl::Size s = { aSize.mWidth, aSize.mHeight };
   aRv = mCameraControl->Set(CAMERA_PARAM_THUMBNAILSIZE, s);
 }
 
 double
--- a/dom/camera/DOMCameraControl.h
+++ b/dom/camera/DOMCameraControl.h
@@ -67,20 +67,16 @@ public:
   void GetSceneMode(nsString& aMode, ErrorResult& aRv);
   void SetSceneMode(const nsAString& aMode, ErrorResult& aRv);
   void GetFlashMode(nsString& aMode, ErrorResult& aRv);
   void SetFlashMode(const nsAString& aMode, ErrorResult& aRv);
   void GetFocusMode(nsString& aMode, ErrorResult& aRv);
   void SetFocusMode(const nsAString& aMode, ErrorResult& aRv);
   double GetZoom(ErrorResult& aRv);
   void SetZoom(double aZoom, ErrorResult& aRv);
-  JS::Value GetPictureSize(JSContext* aCx, ErrorResult& aRv);
-  void SetPictureSize(JSContext* aCx, JS::Handle<JS::Value> aSize, ErrorResult& aRv);
-  JS::Value GetThumbnailSize(JSContext* aCx, ErrorResult& aRv);
-  void SetThumbnailSize(JSContext* aCx, JS::Handle<JS::Value> aSize, ErrorResult& aRv);
   double GetFocalLength(ErrorResult& aRv);
   double GetFocusDistanceNear(ErrorResult& aRv);
   double GetFocusDistanceOptimum(ErrorResult& aRv);
   double GetFocusDistanceFar(ErrorResult& aRv);
   void SetExposureCompensation(const dom::Optional<double>& aCompensation, ErrorResult& aRv);
   double GetExposureCompensation(ErrorResult& aRv);
   int32_t SensorAngle();
   already_AddRefed<dom::CameraCapabilities> Capabilities();
--- a/dom/webidl/CameraControl.webidl
+++ b/dom/webidl/CameraControl.webidl
@@ -247,40 +247,32 @@ interface CameraControl : MediaStream
      the recording process encountered an error, or because one of the
      recording limits (see CameraStartRecordingOptions) was reached. */
   attribute CameraRecorderStateChange? onRecorderStateChange;
 
   /* the function to call when the viewfinder stops or starts,
      useful for synchronizing other UI elements. */
   attribute CameraPreviewStateChange? onPreviewStateChange;
 
-  /* the attribute is deprecated in favour of get/setPictureSize.
-
-     the size of the picture to be returned by a call to takePicture();
+  /* the size of the picture to be returned by a call to takePicture();
      an object with 'height' and 'width' properties that corresponds to
      one of the options returned by capabilities.pictureSizes. */
   [Throws]
-  attribute any              pictureSize;
-  [Throws]
   CameraSize getPictureSize();
   [Throws]
   void setPictureSize(optional CameraSize size);
 
-  /* the attribute is deprecated in favour of get/setThumbnailSize.
-
-     the size of the thumbnail to be included in the picture returned
+  /* the size of the thumbnail to be included in the picture returned
      by a call to takePicture(), assuming the chosen fileFormat supports
      one; an object with 'height' and 'width' properties that corresponds
      to one of the options returned by capabilities.pictureSizes.
 
      this setting should be considered a hint: the implementation will
      respect it when possible, and override it if necessary. */
   [Throws]
-  attribute any              thumbnailSize;
-  [Throws]
   CameraSize getThumbnailSize();
   [Throws]
   void setThumbnailSize(optional CameraSize size);
 
   /* the angle, in degrees, that the image sensor is mounted relative
      to the display; e.g. if 'sensorAngle' is 270 degrees (or -90 degrees),
      then the preview stream needs to be rotated +90 degrees to have the
      same orientation as the real world. */