backout the part of e40a964458f8 that should never have landed
☠☠ backed out by 0299469f7961 ☠ ☠
authorTrevor Saunders <trev.saunders@gmail.com>
Mon, 21 Oct 2013 18:38:50 -0400
changeset 165434 99b17c404db201b6451e2b419d09880a468361cf
parent 165433 9349b9b4b22c98825c6f13732e3c9c717e3cee43
child 165435 0299469f796102b35bc18e6a6d8ca1ab2043d62d
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone27.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
backout the part of e40a964458f8 that should never have landed
dom/camera/CameraControlImpl.cpp
dom/camera/CameraControlImpl.h
dom/camera/DOMCameraControl.cpp
dom/camera/DOMCameraControl.h
dom/camera/GonkCameraControl.cpp
dom/camera/ICameraControl.h
dom/camera/Makefile.in
dom/camera/moz.build
dom/camera/nsIDOMCameraManager.idl
--- a/dom/camera/CameraControlImpl.cpp
+++ b/dom/camera/CameraControlImpl.cpp
@@ -423,22 +423,22 @@ CameraControlImpl::TakePicture(CameraSiz
     cancel = true;
   }
 
   nsCOMPtr<nsIRunnable> takePictureTask = new TakePictureTask(this, cancel, aSize, aRotation, aFileFormat, aPosition, aDateTime, onSuccess, onError);
   return mCameraThread->Dispatch(takePictureTask, NS_DISPATCH_NORMAL);
 }
 
 nsresult
-CameraControlImpl::StartRecording(const CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError)
+CameraControlImpl::StartRecording(CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError)
 {
   nsCOMPtr<nsIFile> clone;
   aFolder->Clone(getter_AddRefs(clone));
 
-  nsCOMPtr<nsIRunnable> startRecordingTask = new StartRecordingTask(this, aOptions, clone, aFilename, onSuccess, onError, mWindowId);
+  nsCOMPtr<nsIRunnable> startRecordingTask = new StartRecordingTask(this, *aOptions, clone, aFilename, onSuccess, onError, mWindowId);
   return mCameraThread->Dispatch(startRecordingTask, NS_DISPATCH_NORMAL);
 }
 
 nsresult
 CameraControlImpl::StopRecording()
 {
   nsCOMPtr<nsIRunnable> stopRecordingTask = new StopRecordingTask(this);
   return mCameraThread->Dispatch(stopRecordingTask, NS_DISPATCH_NORMAL);
@@ -454,19 +454,19 @@ CameraControlImpl::StartPreview(DOMCamer
 void
 CameraControlImpl::StopPreview()
 {
   nsCOMPtr<nsIRunnable> stopPreviewTask = new StopPreviewTask(this);
   mCameraThread->Dispatch(stopPreviewTask, NS_DISPATCH_NORMAL);
 }
 
 nsresult
-CameraControlImpl::GetPreviewStreamVideoMode(const CameraRecorderOptions& aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
+CameraControlImpl::GetPreviewStreamVideoMode(CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
 {
-  nsCOMPtr<nsIRunnable> getPreviewStreamVideoModeTask = new GetPreviewStreamVideoModeTask(this, aOptions, onSuccess, onError);
+  nsCOMPtr<nsIRunnable> getPreviewStreamVideoModeTask = new GetPreviewStreamVideoModeTask(this, *aOptions, onSuccess, onError);
   return mCameraThread->Dispatch(getPreviewStreamVideoModeTask, NS_DISPATCH_NORMAL);
 }
 
 nsresult
 CameraControlImpl::ReleaseHardware(nsICameraReleaseCallback* onSuccess, nsICameraErrorCallback* onError)
 {
   nsCOMPtr<nsIRunnable> releaseHardwareTask = new ReleaseHardwareTask(this, onSuccess, onError);
   return mCameraThread->Dispatch(releaseHardwareTask, NS_DISPATCH_NORMAL);
--- a/dom/camera/CameraControlImpl.h
+++ b/dom/camera/CameraControlImpl.h
@@ -9,17 +9,16 @@
 #include "nsDOMFile.h"
 #include "nsProxyRelease.h"
 #include "DictionaryHelpers.h"
 #include "nsIDOMDeviceStorage.h"
 #include "DOMCameraManager.h"
 #include "DOMCameraPreview.h"
 #include "ICameraControl.h"
 #include "CameraCommon.h"
-#include "mozilla/dom/CameraControlBinding.h"
 
 namespace mozilla {
 
 class GetPreviewStreamTask;
 class StartPreviewTask;
 class StopPreviewTask;
 class AutoFocusTask;
 class TakePictureTask;
@@ -50,21 +49,19 @@ class CameraControlImpl : public ICamera
 public:
   CameraControlImpl(uint32_t aCameraId, nsIThread* aCameraThread, uint64_t aWindowId);
 
   nsresult GetPreviewStream(idl::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult StartPreview(DOMCameraPreview* aDOMPreview);
   void StopPreview();
   nsresult AutoFocus(nsICameraAutoFocusCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult TakePicture(idl::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, idl::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError);
-  nsresult StartRecording(const dom::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError);
+  nsresult StartRecording(idl::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult StopRecording();
-  nsresult GetPreviewStreamVideoMode(const dom::CameraRecorderOptions& aOptions,
-                                     nsICameraPreviewStreamCallback* onSuccess,
-                                     nsICameraErrorCallback* onError);
+  nsresult GetPreviewStreamVideoMode(idl::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult ReleaseHardware(nsICameraReleaseCallback* onSuccess, nsICameraErrorCallback* onError);
 
   nsresult Set(uint32_t aKey, const nsAString& aValue);
   nsresult Get(uint32_t aKey, nsAString& aValue);
   nsresult Set(uint32_t aKey, double aValue);
   nsresult Get(uint32_t aKey, double* aValue);
   nsresult Set(JSContext* aCx, uint32_t aKey, const JS::Value& aValue, uint32_t aLimit);
   nsresult Get(JSContext* aCx, uint32_t aKey, JS::Value* aValue);
@@ -444,19 +441,19 @@ protected:
   nsMainThreadPtrHandle<nsICameraStartRecordingCallback> mOnSuccessCb;
   uint64_t mWindowId;
 };
 
 // Start video recording.
 class StartRecordingTask : public nsRunnable
 {
 public:
-  StartRecordingTask(CameraControlImpl* aCameraControl, const dom::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId)
+  StartRecordingTask(CameraControlImpl* aCameraControl, idl::CameraStartRecordingOptions aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId)
     : mCameraControl(aCameraControl)
-    , mOptions(*aOptions)
+    , mOptions(aOptions)
     , mFolder(aFolder)
     , mFilename(aFilename)
     , mOnSuccessCb(new nsMainThreadPtrHolder<nsICameraStartRecordingCallback>(onSuccess))
     , mOnErrorCb(new nsMainThreadPtrHolder<nsICameraErrorCallback>(onError))
     , mWindowId(aWindowId)
   {
     DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
   }
@@ -482,17 +479,17 @@ public:
     rv = NS_DispatchToMainThread(startRecordingResult);
     if (NS_FAILED(rv)) {
       DOM_CAMERA_LOGE("Failed to dispatch start recording result to main thread (%d)!", rv);
     }
     return rv;
   }
 
   nsRefPtr<CameraControlImpl> mCameraControl;
-  dom::CameraStartRecordingOptions mOptions;
+  idl::CameraStartRecordingOptions mOptions;
   nsCOMPtr<nsIFile> mFolder;
   nsString mFilename;
   nsMainThreadPtrHandle<nsICameraStartRecordingCallback> mOnSuccessCb;
   nsMainThreadPtrHandle<nsICameraErrorCallback> mOnErrorCb;
   uint64_t mWindowId;
 };
 
 // Stop video recording.
@@ -579,17 +576,17 @@ public:
 
   nsRefPtr<CameraControlImpl> mCameraControl;
 };
 
 // Get the video mode preview stream.
 class GetPreviewStreamVideoModeTask : public nsRunnable
 {
 public:
-  GetPreviewStreamVideoModeTask(CameraControlImpl* aCameraControl, const dom::CameraRecorderOptions& aOptions,  nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
+  GetPreviewStreamVideoModeTask(CameraControlImpl* aCameraControl, idl::CameraRecorderOptions aOptions,  nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
     : mCameraControl(aCameraControl)
     , mOptions(aOptions)
     , mOnSuccessCb(new nsMainThreadPtrHolder<nsICameraPreviewStreamCallback>(onSuccess))
     , mOnErrorCb(new nsMainThreadPtrHolder<nsICameraErrorCallback>(onError))
   { }
 
   NS_IMETHOD Run() MOZ_OVERRIDE
   {
@@ -601,17 +598,17 @@ public:
       nsCOMPtr<nsIRunnable> cameraErrorResult = new CameraErrorResult(mOnErrorCb, NS_LITERAL_STRING("FAILURE"), mCameraControl->GetWindowId());
       rv = NS_DispatchToMainThread(cameraErrorResult);
       NS_ENSURE_SUCCESS(rv, rv);
     }
     return NS_OK;
   }
 
   nsRefPtr<CameraControlImpl> mCameraControl;
-  dom::CameraRecorderOptions mOptions;
+  idl::CameraRecorderOptions mOptions;
   nsMainThreadPtrHandle<nsICameraPreviewStreamCallback> mOnSuccessCb;
   nsMainThreadPtrHandle<nsICameraErrorCallback> mOnErrorCb;
 };
 
 // Return the result of releasing the camera hardware.  Runs on the main thread.
 class ReleaseHardwareResult : public nsRunnable
 {
 public:
--- a/dom/camera/DOMCameraControl.cpp
+++ b/dom/camera/DOMCameraControl.cpp
@@ -246,24 +246,36 @@ nsDOMCameraControl::GetOnRecorderStateCh
 void
 nsDOMCameraControl::SetOnRecorderStateChange(nsICameraRecorderStateChange* aOnRecorderStateChange,
                                              ErrorResult& aRv)
 {
   aRv = mCameraControl->Set(aOnRecorderStateChange);
 }
 
 void
-nsDOMCameraControl::StartRecording(const CameraStartRecordingOptions& aOptions,
+nsDOMCameraControl::StartRecording(JSContext* aCx,
+                                   JS::Handle<JS::Value> aOptions,
                                    nsDOMDeviceStorage& storageArea,
                                    const nsAString& filename,
                                    nsICameraStartRecordingCallback* onSuccess,
                                    const Optional<nsICameraErrorCallback*>& onError,
                                    ErrorResult& aRv)
 {
   MOZ_ASSERT(onSuccess, "no onSuccess handler passed");
+  mozilla::idl::CameraStartRecordingOptions options;
+
+  // Default values, until the dictionary parser can handle them.
+  options.rotation = 0;
+  options.maxFileSizeBytes = 0;
+  options.maxVideoLengthMs = 0;
+  aRv = options.Init(aCx, aOptions.address());
+  if (aRv.Failed()) {
+    return;
+  }
+
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (!obs) {
     NS_WARNING("Could not get the Observer service for CameraControl::StartRecording.");
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   obs->NotifyObservers(nullptr,
@@ -288,17 +300,17 @@ nsDOMCameraControl::StartRecording(const
   }
   #endif
 
   nsCOMPtr<nsIFile> folder;
   aRv = storageArea.GetRootDirectoryForFile(filename, getter_AddRefs(folder));
   if (aRv.Failed()) {
     return;
   }
-  aRv = mCameraControl->StartRecording(&aOptions, folder, filename, onSuccess,
+  aRv = mCameraControl->StartRecording(&options, folder, filename, onSuccess,
                                        onError.WasPassed() ? onError.Value() : nullptr);
 }
 
 void
 nsDOMCameraControl::StopRecording(ErrorResult& aRv)
 {
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (!obs) {
@@ -403,22 +415,29 @@ nsDOMCameraControl::TakePicture(JSContex
   nsICameraErrorCallback* onError =
     aOnError.WasPassed() ? aOnError.Value() : nullptr;
   aRv = mCameraControl->TakePicture(size, aOptions.mRotation,
                                     aOptions.mFileFormat, pos,
                                     aOptions.mDateTime, onSuccess, onError);
 }
 
 void
-nsDOMCameraControl::GetPreviewStreamVideoMode(const CameraRecorderOptions& aOptions,
+nsDOMCameraControl::GetPreviewStreamVideoMode(JSContext* aCx,
+                                              JS::Handle<JS::Value> aOptions,
                                               nsICameraPreviewStreamCallback* onSuccess,
                                               const Optional<nsICameraErrorCallback*>& onError,
                                               ErrorResult& aRv)
 {
-  aRv = mCameraControl->GetPreviewStreamVideoMode(aOptions, onSuccess,
+  mozilla::idl::CameraRecorderOptions options;
+  aRv = options.Init(aCx, aOptions.address());
+  if (aRv.Failed()) {
+    return;
+  }
+
+  aRv = mCameraControl->GetPreviewStreamVideoMode(&options, onSuccess,
                                                   onError.WasPassed()
                                                   ? onError.Value() : nullptr);
 }
 
 void
 nsDOMCameraControl::ReleaseHardware(const Optional<nsICameraReleaseCallback*>& onSuccess,
                                     const Optional<nsICameraErrorCallback*>& onError,
                                     ErrorResult& aRv)
--- a/dom/camera/DOMCameraControl.h
+++ b/dom/camera/DOMCameraControl.h
@@ -17,17 +17,16 @@
 #include "nsProxyRelease.h"
 
 class nsDOMDeviceStorage;
 class nsPIDOMWindow;
 
 namespace mozilla {
 namespace dom {
 class CameraPictureOptions;
-class CameraRecorderOptions;
 template<typename T> class Optional;
 }
 class ErrorResult;
 
 // Main camera control.
 class nsDOMCameraControl MOZ_FINAL : public nsISupports,
                                      public nsWrapperCache
 {
@@ -80,26 +79,18 @@ public:
   void SetOnRecorderStateChange(nsICameraRecorderStateChange* aCb, ErrorResult& aRv);
   void AutoFocus(nsICameraAutoFocusCallback* aOnSuccess, const dom::Optional<nsICameraErrorCallback*>& aOnErro, ErrorResult& aRvr);
   void TakePicture(JSContext* aCx, const dom::CameraPictureOptions& aOptions,
                    nsICameraTakePictureCallback* onSuccess,
                    const dom::Optional<nsICameraErrorCallback* >& onError,
                    ErrorResult& aRv);
   already_AddRefed<nsICameraPreviewStateChange> GetOnPreviewStateChange() const;
   void SetOnPreviewStateChange(nsICameraPreviewStateChange* aOnStateChange);
-  void GetPreviewStreamVideoMode(const dom::CameraRecorderOptions& aOptions,
-                                 nsICameraPreviewStreamCallback* onSuccess,
-                                 const dom::Optional<nsICameraErrorCallback* >& onError,
-                                 ErrorResult& aRv);
-  void StartRecording(const dom::CameraStartRecordingOptions& aOptions,
-                      nsDOMDeviceStorage& storageArea,
-                      const nsAString& filename,
-                      nsICameraStartRecordingCallback* onSuccess,
-                      const dom::Optional<nsICameraErrorCallback* >& onError,
-                      ErrorResult& aRv);
+  void GetPreviewStreamVideoMode(JSContext* cx, JS::Handle<JS::Value> aOptions, nsICameraPreviewStreamCallback* onSuccess, const dom::Optional<nsICameraErrorCallback* >& onError, ErrorResult& aRv);
+  void StartRecording(JSContext* cx, JS::Handle<JS::Value> aOptions, nsDOMDeviceStorage& storageArea, const nsAString& filename, nsICameraStartRecordingCallback* onSuccess, const dom::Optional<nsICameraErrorCallback* >& onError, ErrorResult& aRv);
   void StopRecording(ErrorResult& aRv);
   void GetPreviewStream(JSContext* cx, JS::Handle<JS::Value> aOptions, nsICameraPreviewStreamCallback* onSuccess, const dom::Optional<nsICameraErrorCallback* >& onError, ErrorResult& aRv);
   void ResumePreview(ErrorResult& aRv);
   void ReleaseHardware(const dom::Optional<nsICameraReleaseCallback* >& onSuccess, const dom::Optional<nsICameraErrorCallback* >& onError, ErrorResult& aRv);
 
 protected:
   virtual ~nsDOMCameraControl();
 
--- a/dom/camera/GonkCameraControl.cpp
+++ b/dom/camera/GonkCameraControl.cpp
@@ -944,17 +944,17 @@ nsGonkCameraControl::StartRecordingImpl(
   }
 
   ScopedClose fd(open(nativeFilename.get(), O_RDWR | O_CREAT, 0644));
   if (fd < 0) {
     DOM_CAMERA_LOGE("Couldn't create file '%s': (%d) %s\n", nativeFilename.get(), errno, strerror(errno));
     return NS_ERROR_FAILURE;
   }
 
-  rv = SetupRecording(fd, aStartRecording->mOptions.mRotation, aStartRecording->mOptions.mMaxFileSizeBytes, aStartRecording->mOptions.mMaxVideoLengthMs);
+  rv = SetupRecording(fd, aStartRecording->mOptions.rotation, aStartRecording->mOptions.maxFileSizeBytes, aStartRecording->mOptions.maxVideoLengthMs);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mRecorder->start() != OK) {
     DOM_CAMERA_LOGE("mRecorder->start() failed\n");
     // important: we MUST destroy the recorder if start() fails!
     mRecorder = nullptr;
     return NS_ERROR_FAILURE;
   }
@@ -1120,18 +1120,17 @@ nsGonkCameraControl::SetPreviewSize(uint
 
 nsresult
 nsGonkCameraControl::SetupVideoMode(const nsAString& aProfile)
 {
   // read preferences for camcorder
   mMediaProfiles = MediaProfiles::getInstance();
 
   nsAutoCString profile = NS_ConvertUTF16toUTF8(aProfile);
-  nsRefPtr<GonkRecorderProfileManager> mgr = GetGonkRecorderProfileManager();
-  mRecorderProfile = mgr->Get(profile.get());
+  mRecorderProfile = GetGonkRecorderProfileManager().get()->Get(profile.get());
   if (!mRecorderProfile) {
     DOM_CAMERA_LOGE("Recorder profile '%s' is not supported\n", profile.get());
     return NS_ERROR_INVALID_ARG;
   }
 
   const GonkRecorderVideoProfile* video = mRecorderProfile->GetGonkVideoProfile();
   int width = video->GetWidth();
   int height = video->GetHeight();
@@ -1365,17 +1364,17 @@ nsGonkCameraControl::SetupRecording(int 
 
 nsresult
 nsGonkCameraControl::GetPreviewStreamVideoModeImpl(GetPreviewStreamVideoModeTask* aGetPreviewStreamVideoMode)
 {
   // stop any currently running preview
   StopPreviewInternal(true /* forced */);
 
   // setup the video mode
-  nsresult rv = SetupVideoMode(aGetPreviewStreamVideoMode->mOptions.mProfile);
+  nsresult rv = SetupVideoMode(aGetPreviewStreamVideoMode->mOptions.profile);
   NS_ENSURE_SUCCESS(rv, rv);
   
   const RecorderVideoProfile* video = mRecorderProfile->GetVideoProfile();
   int width = video->GetWidth();
   int height = video->GetHeight();
   int fps = video->GetFramerate();
   DOM_CAMERA_LOGI("recording preview format: %d x %d (%d fps)\n", width, height, fps);
 
--- a/dom/camera/ICameraControl.h
+++ b/dom/camera/ICameraControl.h
@@ -6,38 +6,34 @@
 #define DOM_CAMERA_ICAMERACONTROL_H
 
 #include "nsIFile.h"
 #include "nsIDOMCameraManager.h"
 #include "DictionaryHelpers.h"
 #include "CameraCommon.h"
 
 namespace mozilla {
-namespace dom {
-class CameraStartRecordingOptions;
-class CameraRecorderOptions;
-}
 
 
 class DOMCameraPreview;
 class RecorderProfileManager;
 
 class ICameraControl
 {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ICameraControl)
 
   virtual nsresult GetPreviewStream(idl::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult StartPreview(DOMCameraPreview* aDOMPreview) = 0;
   virtual void StopPreview() = 0;
   virtual nsresult AutoFocus(nsICameraAutoFocusCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult TakePicture(idl::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, idl::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
-  virtual nsresult StartRecording(const dom::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult StartRecording(idl::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult StopRecording() = 0;
-  virtual nsresult GetPreviewStreamVideoMode(const dom::CameraRecorderOptions& aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult GetPreviewStreamVideoMode(idl::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult ReleaseHardware(nsICameraReleaseCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
 
   virtual nsresult Set(uint32_t aKey, const nsAString& aValue) = 0;
   virtual nsresult Get(uint32_t aKey, nsAString& aValue) = 0;
   virtual nsresult Set(uint32_t aKey, double aValue) = 0;
   virtual nsresult Get(uint32_t aKey, double* aValue) = 0;
   virtual nsresult Set(JSContext* aCx, uint32_t aKey, const JS::Value& aValue, uint32_t aLimit) = 0;
   virtual nsresult Get(JSContext* aCx, uint32_t aKey, JS::Value* aValue) = 0;
--- a/dom/camera/Makefile.in
+++ b/dom/camera/Makefile.in
@@ -1,6 +1,7 @@
 # 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 $(topsrcdir)/dom/dom-config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/dom/camera/moz.build
+++ b/dom/camera/moz.build
@@ -48,11 +48,8 @@ else:
     ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domcamera_s'
 
-LOCAL_INCLUDES += [
-    '../base',
-]
--- a/dom/camera/nsIDOMCameraManager.idl
+++ b/dom/camera/nsIDOMCameraManager.idl
@@ -105,16 +105,63 @@ interface nsICameraCapabilities : nsISup
 
     /* an object with attributes for each of the supported recorder
        profiles, e.g. recorderProfiles.cif, recorderProfiles.qvga,
        etc. */
     [implicit_jscontext]
     readonly attribute jsval        recorderProfiles;
 };
 
+/* These properties affect the video recording preview, e.g.
+      {
+         profile: "1080p",
+         rotation: 0
+      }
+
+   'profile' is one of the profiles returned by
+   nsICameraCapabilities.recorderProfiles'; if this profile is missing,
+   an arbitrary profile will be chosen.
+
+   'rotation' is the degrees clockwise to rotate the preview; if
+   this option is not supported, it will be ignored; if this option
+   is missing, the default is 0.
+*/
+dictionary CameraRecorderOptions
+{
+    DOMString profile;
+    long      rotation;
+};
+
+/* These properties affect the actual video recording, e.g.
+      {
+         rotation: 0,
+         maxFileSizeBytes: 1024 * 1024,
+         maxVideoLengthMs: 0
+      }
+
+   'rotation' is the degrees clockwise to rotate the recorded video; if
+   this options is not supported, it will be ignored; if this option is
+   missing, the default is 0.
+
+   'maxFileSizeBytes' is the maximum size in bytes to which the recorded
+   video file will be allowed to grow.
+
+   'maxVideoLengthMs' is the maximum length in milliseconds to which the
+   recorded video will be allowed to grow.
+
+   if either 'maxFileSizeBytes' or 'maxVideoLengthMs' is missing, zero,
+   or negative, that limit will be disabled.
+*/
+dictionary CameraStartRecordingOptions
+{
+    long      rotation;
+    long long maxFileSizeBytes;
+    long long maxVideoLengthMs;
+};
+
 [scriptable, function, uuid(0444a687-4bc9-462c-8246-5423f0fe46a4)]
 interface nsICameraPreviewStreamCallback : nsISupports
 {
     void handleEvent(in nsIDOMMediaStream stream);
 };
 
 [scriptable, function, uuid(6baa4ac7-9c25-4c48-9bb0-5193b38b9b0a)]
 interface nsICameraAutoFocusCallback : nsISupports