bug 922566 - kill dom-config.mk r=gps
authorTrevor Saunders <trev.saunders@gmail.com>
Fri, 11 Oct 2013 12:02:41 -0400
changeset 160240 e40a964458f8991bfbecccfc395045d2339a15e9
parent 160239 8a4bcbdf410909bf0f714ea3da08343395b57d39
child 160241 9b0f18ffd8f1af32a9f5c26e99cb013451f60541
push id4537
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 22:18:47 +0000
treeherdermozilla-aurora@60c6fd67470e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs922566
milestone27.0a1
bug 922566 - kill dom-config.mk r=gps
content/media/webspeech/recognition/Makefile.in
content/media/webspeech/recognition/moz.build
content/media/webspeech/synth/Makefile.in
content/media/webspeech/synth/pico/Makefile.in
dom/alarm/Makefile.in
dom/apps/src/Makefile.in
dom/base/Makefile.in
dom/base/moz.build
dom/battery/Makefile.in
dom/bindings/Makefile.in
dom/bindings/moz.build
dom/bindings/test/Makefile.in
dom/bluetooth/Makefile.in
dom/bluetooth/moz.build
dom/browser-element/Makefile.in
dom/browser-element/moz.build
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
dom/devicestorage/Makefile.in
dom/dom-config.mk
dom/encoding/Makefile.in
dom/fmradio/Makefile.in
dom/fmradio/ipc/Makefile.in
dom/fmradio/ipc/moz.build
dom/fmradio/moz.build
dom/icc/src/Makefile.in
dom/media/Makefile.in
dom/media/moz.build
dom/mobilemessage/src/Makefile.in
dom/mobilemessage/src/moz.build
dom/network/src/Makefile.in
dom/plugins/base/Makefile.in
dom/plugins/base/moz.build
dom/power/Makefile.in
dom/quota/Makefile.in
dom/system/gonk/Makefile.in
dom/telephony/Makefile.in
dom/time/Makefile.in
dom/webidl/CameraControl.webidl
dom/wifi/Makefile.in
--- a/content/media/webspeech/recognition/Makefile.in
+++ b/content/media/webspeech/recognition/Makefile.in
@@ -1,7 +1,6 @@
 # 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/content/media/webspeech/recognition/moz.build
+++ b/content/media/webspeech/recognition/moz.build
@@ -39,8 +39,11 @@ CPP_SOURCES += [
     'energy_endpointer_params.cc',
     'test/FakeSpeechRecognitionService.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconwebspeechrecognition_s'
 
+LOCAL_INCLUDES += [
+    '/dom/base',
+]
--- a/content/media/webspeech/synth/Makefile.in
+++ b/content/media/webspeech/synth/Makefile.in
@@ -1,13 +1,12 @@
 # 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
 
 VPATH += \
   $(srcdir)/ipc \
   $(NULL)
 
 LOCAL_INCLUDES += $(VPATH:%=-I%)
 
 include $(topsrcdir)/config/rules.mk
--- a/content/media/webspeech/synth/pico/Makefile.in
+++ b/content/media/webspeech/synth/pico/Makefile.in
@@ -1,9 +1,6 @@
 # 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 $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/dom/dom-config.mk
-
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/dom/alarm/Makefile.in
+++ b/dom/alarm/Makefile.in
@@ -1,9 +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/apps/src/Makefile.in
+++ b/dom/apps/src/Makefile.in
@@ -1,10 +1,9 @@
 # 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/.
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/js/xpconnect/wrappers \
   $(NULL)
 
-include $(topsrcdir)/dom/dom-config.mk
 include $(topsrcdir)/config/rules.mk
--- a/dom/base/Makefile.in
+++ b/dom/base/Makefile.in
@@ -1,14 +1,12 @@
 # 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
-
 ifdef MOZ_JSDEBUGGER
 DEFINES += -DMOZ_JSDEBUGGER
 endif
 
 ifdef MOZ_B2G_RIL
 DEFINES += -DMOZ_B2G_RIL
 endif
 
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -120,8 +120,32 @@ EXTRA_JS_MODULES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'jsdombase_s'
 
+LOCAL_INCLUDES += [
+    '../battery',
+    '../bluetooth',
+    '../icc/src',
+    '../media',
+    '../network/src',
+    '../src/geolocation',
+    '../src/storage',
+    '../time',
+    '/content/base/src',
+    '/content/events/src',
+    '/content/html/document/src',
+    '/content/xbl/src',
+    '/content/xul/document/src',
+    '/layout/generic',
+    '/layout/style',
+    '/layout/xul/base/src',
+]
+
+if CONFIG['MOZ_B2G_RIL']:
+    LOCAL_INCLUDES += [
+        '../fmradio',
+        '../system/gonk',
+    ]
--- a/dom/battery/Makefile.in
+++ b/dom/battery/Makefile.in
@@ -1,12 +1,11 @@
 # 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
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/content/events/src \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -1,15 +1,12 @@
 # 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/.
 
-# Need this to find all our DOM source files.
-include $(topsrcdir)/dom/dom-config.mk
-
 webidl_base = $(topsrcdir)/dom/webidl
 # Generated by moz.build
 include webidlsrcs.mk
 
 binding_include_path := mozilla/dom
 webidl_files += $(generated_events_webidl_files)
 all_webidl_files = $(webidl_files) $(generated_webidl_files) $(preprocessed_webidl_files)
 
--- a/dom/bindings/moz.build
+++ b/dom/bindings/moz.build
@@ -38,8 +38,23 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'dombindings_s'
 
 EXPORT_LIBRARY = True
 
+LOCAL_INCLUDES += [
+    '../bluetooth',
+    '../camera',
+    '../file',
+    '../src/geolocation',
+    '../workers',
+    '/content/base/src',
+    '/content/events/src',
+    '/content/html/document/src',
+    '/content/media/webaudio',
+    '/content/svg/content/src',
+    '/content/xbl/src',
+    '/layout/style',
+    '/layout/xul/tree',
+]
--- a/dom/bindings/test/Makefile.in
+++ b/dom/bindings/test/Makefile.in
@@ -5,20 +5,17 @@
 # Do NOT export this library.  We don't actually want our test code
 # being added to libxul or anything.
 
 # pymake can't handle descending into dom/bindings several times simultaneously
 ifdef .PYMAKE
 .NOTPARALLEL:
 endif
 
-# Need this to find all our DOM source files.
-include $(topsrcdir)/dom/dom-config.mk
-
-# And need this for $(test_webidl_files) and $(preprocessed_test_webidl_files)
+# Need this for $(test_webidl_files)
 include ../webidlsrcs.mk
 
 # But the webidl actually lives in our parent dir
 test_webidl_files := $(addprefix ../,$(test_webidl_files))
 # Store the actual locations of our source preprocessed files, so we
 # can depend on them sanely.
 source_preprocessed_test_webidl_files := $(addprefix $(srcdir)/,$(preprocessed_test_webidl_files))
 preprocessed_test_webidl_files := $(addprefix ../,$(preprocessed_test_webidl_files))
--- a/dom/bluetooth/Makefile.in
+++ b/dom/bluetooth/Makefile.in
@@ -7,18 +7,16 @@
 #     http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-include $(topsrcdir)/dom/dom-config.mk
-
 VPATH += $(srcdir)/ipc
 
 ifneq (,$(MOZ_B2G_BT))
 
 
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
 VPATH += \
   $(srcdir)/linux \
--- a/dom/bluetooth/moz.build
+++ b/dom/bluetooth/moz.build
@@ -74,8 +74,13 @@ EXPORTS.mozilla.dom.bluetooth += [
 IPDL_SOURCES += [
     'ipc/BluetoothTypes.ipdlh',
     'ipc/PBluetooth.ipdl',
     'ipc/PBluetoothRequest.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
+LOCAL_INCLUDES += [
+    '../base',
+    '../network/src',
+    '../system/gonk',
+]
--- a/dom/browser-element/Makefile.in
+++ b/dom/browser-element/Makefile.in
@@ -1,15 +1,12 @@
 # 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
 
 INCLUDES	+= \
 		-I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/dom/ \
 		-I$(topsrcdir)/dom/ipc \
 		-I$(topsrcdir)/content/base/src \
--- a/dom/browser-element/moz.build
+++ b/dom/browser-element/moz.build
@@ -29,8 +29,12 @@ EXTRA_JS_MODULES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_browserelement_s'
 
+LOCAL_INCLUDES += [
+    '../bluetooth',
+    '/content/html/content/src',
+]
--- 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(CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError)
+CameraControlImpl::StartRecording(const 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(CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
+CameraControlImpl::GetPreviewStreamVideoMode(const 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,16 +9,17 @@
 #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;
@@ -49,19 +50,21 @@ 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(idl::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError);
+  nsresult StartRecording(const dom::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult StopRecording();
-  nsresult GetPreviewStreamVideoMode(idl::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError);
+  nsresult GetPreviewStreamVideoMode(const dom::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);
@@ -441,19 +444,19 @@ protected:
   nsMainThreadPtrHandle<nsICameraStartRecordingCallback> mOnSuccessCb;
   uint64_t mWindowId;
 };
 
 // Start video recording.
 class StartRecordingTask : public nsRunnable
 {
 public:
-  StartRecordingTask(CameraControlImpl* aCameraControl, idl::CameraStartRecordingOptions aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId)
+  StartRecordingTask(CameraControlImpl* aCameraControl, const dom::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);
   }
@@ -479,17 +482,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;
-  idl::CameraStartRecordingOptions mOptions;
+  dom::CameraStartRecordingOptions mOptions;
   nsCOMPtr<nsIFile> mFolder;
   nsString mFilename;
   nsMainThreadPtrHandle<nsICameraStartRecordingCallback> mOnSuccessCb;
   nsMainThreadPtrHandle<nsICameraErrorCallback> mOnErrorCb;
   uint64_t mWindowId;
 };
 
 // Stop video recording.
@@ -576,17 +579,17 @@ public:
 
   nsRefPtr<CameraControlImpl> mCameraControl;
 };
 
 // Get the video mode preview stream.
 class GetPreviewStreamVideoModeTask : public nsRunnable
 {
 public:
-  GetPreviewStreamVideoModeTask(CameraControlImpl* aCameraControl, idl::CameraRecorderOptions aOptions,  nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
+  GetPreviewStreamVideoModeTask(CameraControlImpl* aCameraControl, const dom::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
   {
@@ -598,17 +601,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;
-  idl::CameraRecorderOptions mOptions;
+  dom::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,36 +246,24 @@ nsDOMCameraControl::GetOnRecorderStateCh
 void
 nsDOMCameraControl::SetOnRecorderStateChange(nsICameraRecorderStateChange* aOnRecorderStateChange,
                                              ErrorResult& aRv)
 {
   aRv = mCameraControl->Set(aOnRecorderStateChange);
 }
 
 void
-nsDOMCameraControl::StartRecording(JSContext* aCx,
-                                   JS::Handle<JS::Value> aOptions,
+nsDOMCameraControl::StartRecording(const CameraStartRecordingOptions& 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,
@@ -300,17 +288,17 @@ nsDOMCameraControl::StartRecording(JSCon
   }
   #endif
 
   nsCOMPtr<nsIFile> folder;
   aRv = storageArea.GetRootDirectoryForFile(filename, getter_AddRefs(folder));
   if (aRv.Failed()) {
     return;
   }
-  aRv = mCameraControl->StartRecording(&options, folder, filename, onSuccess,
+  aRv = mCameraControl->StartRecording(&aOptions, folder, filename, onSuccess,
                                        onError.WasPassed() ? onError.Value() : nullptr);
 }
 
 void
 nsDOMCameraControl::StopRecording(ErrorResult& aRv)
 {
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (!obs) {
@@ -415,29 +403,22 @@ 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(JSContext* aCx,
-                                              JS::Handle<JS::Value> aOptions,
+nsDOMCameraControl::GetPreviewStreamVideoMode(const CameraRecorderOptions& aOptions,
                                               nsICameraPreviewStreamCallback* onSuccess,
                                               const Optional<nsICameraErrorCallback*>& onError,
                                               ErrorResult& aRv)
 {
-  mozilla::idl::CameraRecorderOptions options;
-  aRv = options.Init(aCx, aOptions.address());
-  if (aRv.Failed()) {
-    return;
-  }
-
-  aRv = mCameraControl->GetPreviewStreamVideoMode(&options, onSuccess,
+  aRv = mCameraControl->GetPreviewStreamVideoMode(aOptions, 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,16 +17,17 @@
 #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
 {
@@ -79,18 +80,26 @@ 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(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 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 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.rotation, aStartRecording->mOptions.maxFileSizeBytes, aStartRecording->mOptions.maxVideoLengthMs);
+  rv = SetupRecording(fd, aStartRecording->mOptions.mRotation, aStartRecording->mOptions.mMaxFileSizeBytes, aStartRecording->mOptions.mMaxVideoLengthMs);
   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,17 +1120,18 @@ nsGonkCameraControl::SetPreviewSize(uint
 
 nsresult
 nsGonkCameraControl::SetupVideoMode(const nsAString& aProfile)
 {
   // read preferences for camcorder
   mMediaProfiles = MediaProfiles::getInstance();
 
   nsAutoCString profile = NS_ConvertUTF16toUTF8(aProfile);
-  mRecorderProfile = GetGonkRecorderProfileManager().get()->Get(profile.get());
+  nsRefPtr<GonkRecorderProfileManager> mgr = GetGonkRecorderProfileManager();
+  mRecorderProfile = mgr->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();
@@ -1364,17 +1365,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.profile);
+  nsresult rv = SetupVideoMode(aGetPreviewStreamVideoMode->mOptions.mProfile);
   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,34 +6,38 @@
 #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(idl::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult StartRecording(const dom::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult StopRecording() = 0;
-  virtual nsresult GetPreviewStreamVideoMode(idl::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult GetPreviewStreamVideoMode(const dom::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,7 +1,6 @@
 # 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,8 +48,11 @@ 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,63 +105,16 @@ 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
--- a/dom/devicestorage/Makefile.in
+++ b/dom/devicestorage/Makefile.in
@@ -1,13 +1,12 @@
 # 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
 
 LOCAL_INCLUDES = \
 		-I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/dom/ipc \
 		-I$(topsrcdir)/content/base/src \
 		-I$(topsrcdir)/content/events/src \
 		$(NULL)
 
deleted file mode 100644
--- a/dom/dom-config.mk
+++ /dev/null
@@ -1,62 +0,0 @@
-# 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/.
-
-DOM_SRCDIRS = \
-  dom/base \
-  dom/battery \
-  dom/encoding \
-  dom/file \
-  dom/power \
-  dom/push \
-  dom/quota \
-  dom/media \
-  dom/network/src \
-  dom/phonenumberutils \
-  dom/alarm \
-  dom/src/events \
-  dom/src/storage \
-  dom/src/offline \
-  dom/src/geolocation \
-  dom/src/notification \
-  dom/workers \
-  dom/time \
-  content/xbl/src \
-  content/xul/document/src \
-  content/events/src \
-  content/base/src \
-  content/html/content/src \
-  content/html/document/src \
-  content/media/mediasource \
-  content/media/webaudio \
-  content/svg/content/src \
-  layout/generic \
-  layout/style \
-  layout/xul/base/src \
-  layout/xul/tree \
-  dom/camera \
-  $(NULL)
-
-ifdef MOZ_B2G_RIL
-DOM_SRCDIRS += \
-  dom/system/gonk \
-  dom/wifi \
-  dom/icc/src \
-  $(NULL)
-endif
-
-ifdef MOZ_B2G_FM
-DOM_SRCDIRS += \
-  dom/fmradio \
-  $(NULL)
-endif
-
-ifdef MOZ_B2G_BT
-DOM_SRCDIRS += dom/bluetooth
-endif
-
-ifdef MOZ_WEBSPEECH
-DOM_SRCDIRS += content/media/webspeech
-endif
-
-LOCAL_INCLUDES += $(DOM_SRCDIRS:%=-I$(topsrcdir)/%)
--- a/dom/encoding/Makefile.in
+++ b/dom/encoding/Makefile.in
@@ -1,17 +1,16 @@
 # 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/.
 
 LOCAL_INCLUDES = \
 	-I$(topsrcdir)/intl/locale/src \
 	$(NULL)
 
-include $(topsrcdir)/dom/dom-config.mk
 include $(topsrcdir)/config/rules.mk
 
 EncodingUtils.$(OBJ_SUFFIX): labelsencodings.properties.h
 
 PROPS2ARRAYS = $(topsrcdir)/intl/locale/src/props2arrays.py
 labelsencodings.properties.h: $(PROPS2ARRAYS) labelsencodings.properties
 	$(PYTHON) $^ $@
 
--- a/dom/fmradio/Makefile.in
+++ b/dom/fmradio/Makefile.in
@@ -1,9 +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/fmradio/ipc/Makefile.in
+++ b/dom/fmradio/ipc/Makefile.in
@@ -1,13 +1,12 @@
 # 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/.
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/dom/fmradio \
   $(NULL)
 
-include $(topsrcdir)/dom/dom-config.mk
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
--- a/dom/fmradio/ipc/moz.build
+++ b/dom/fmradio/ipc/moz.build
@@ -18,8 +18,11 @@ CPP_SOURCES += [
     'FMRadioRequestParent.cpp',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 LIBRARY_NAME   = 'domfmradio_s'
 
+LOCAL_INCLUDES += [
+    '/dom/base',
+]
--- a/dom/fmradio/moz.build
+++ b/dom/fmradio/moz.build
@@ -28,8 +28,12 @@ if CONFIG['MOZ_B2G_FM']:
 
 IPDL_SOURCES += [
     'ipc/PFMRadio.ipdl',
     'ipc/PFMRadioRequest.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
+LOCAL_INCLUDES += [
+    '../base',
+    '../system/gonk',
+]
--- a/dom/icc/src/Makefile.in
+++ b/dom/icc/src/Makefile.in
@@ -1,14 +1,10 @@
 # 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/.
 
-VPATH            = $(srcdir)
-
-include $(topsrcdir)/dom/dom-config.mk
-
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/content/events/src \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/dom/media/Makefile.in
+++ b/dom/media/Makefile.in
@@ -1,15 +1,12 @@
 # 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
-
-
 ifdef MOZ_WEBRTC
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/media/webrtc/trunk \
   -I$(topsrcdir)/media/webrtc/signaling/src/common \
   $(NULL)
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -46,8 +46,12 @@ if CONFIG['MOZ_B2G']:
     ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_media_s'
 
+LOCAL_INCLUDES += [
+    '../base',
+    '../camera',
+]
--- a/dom/mobilemessage/src/Makefile.in
+++ b/dom/mobilemessage/src/Makefile.in
@@ -1,7 +1,6 @@
 # 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/mobilemessage/src/moz.build
+++ b/dom/mobilemessage/src/moz.build
@@ -77,8 +77,11 @@ IPDL_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'dom_mobilemessage_s'
 
+LOCAL_INCLUDES += [
+    '/dom/base',
+]
--- a/dom/network/src/Makefile.in
+++ b/dom/network/src/Makefile.in
@@ -1,18 +1,13 @@
 # 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/.
 
-VPATH            = $(srcdir)
 
-ifdef MOZ_B2G_RIL
-endif
-
-include $(topsrcdir)/dom/dom-config.mk
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/content/events/src \
   $(NULL)
 
 ifdef MOZ_B2G_RIL
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/dom/icc/src \
--- a/dom/plugins/base/Makefile.in
+++ b/dom/plugins/base/Makefile.in
@@ -17,13 +17,12 @@ LOCAL_INCLUDES += \
   -I$(topsrcdir)/widget/xpwidgets \
   -I$(topsrcdir)/xpcom/base/ \
   -I$(topsrcdir)/gfx/skia/include/core \
   -I$(topsrcdir)/gfx/skia/include/config \
   $(MOZ_CAIRO_CFLAGS) \
   $(MOZ_PIXMAN_CFLAGS) \
   $(NULL)
 
-include $(topsrcdir)/dom/dom-config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 CXXFLAGS         += $(TK_CFLAGS)
--- a/dom/plugins/base/moz.build
+++ b/dom/plugins/base/moz.build
@@ -98,8 +98,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'andr
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkplugin'
 
 EXPORT_LIBRARY = True
 
+LOCAL_INCLUDES += [
+    '/content/base/src',
+    '/dom/base',
+    '/layout/generic',
+    '/layout/xul/base/src',
+]
--- a/dom/power/Makefile.in
+++ b/dom/power/Makefile.in
@@ -1,8 +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/quota/Makefile.in
+++ b/dom/quota/Makefile.in
@@ -1,12 +1,11 @@
 # 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
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/caps/include \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/dom/system/gonk/Makefile.in
+++ b/dom/system/gonk/Makefile.in
@@ -7,18 +7,16 @@
 #     http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-include $(topsrcdir)/dom/dom-config.mk
-
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/dom/base \
   -I$(topsrcdir)/dom/src/geolocation \
   -I$(topsrcdir)/dom/wifi \
   -I$(topsrcdir)/dom/bluetooth \
   -I$(topsrcdir)/content/events/src \
   $(NULL)
 
--- a/dom/telephony/Makefile.in
+++ b/dom/telephony/Makefile.in
@@ -1,7 +1,6 @@
 # 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/time/Makefile.in
+++ b/dom/time/Makefile.in
@@ -1,8 +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/webidl/CameraControl.webidl
+++ b/dom/webidl/CameraControl.webidl
@@ -149,22 +149,22 @@ interface CameraControl {
     [Throws]
     void takePicture(CameraPictureOptions aOptions,
                      CameraTakePictureCallback onSuccess,
                      optional CameraErrorCallback onError);
 
     /* get a media stream to be used as a camera viewfinder in video mode;
        'aOptions' is an CameraRecorderOptions object. */
     [Throws]
-    void getPreviewStreamVideoMode(any aOptions, CameraPreviewStreamCallback onSuccess, optional CameraErrorCallback onError);
+    void getPreviewStreamVideoMode(CameraRecorderOptions aOptions, CameraPreviewStreamCallback onSuccess, optional CameraErrorCallback onError);
 
     /* start recording video; 'aOptions' is a
        CameraStartRecordingOptions object. */
     [Throws]
-    void startRecording(any aOptions, DeviceStorage storageArea, DOMString filename, CameraStartRecordingCallback onSuccess, optional CameraErrorCallback onError);
+    void startRecording(CameraStartRecordingOptions aOptions, DeviceStorage storageArea, DOMString filename, CameraStartRecordingCallback onSuccess, optional CameraErrorCallback onError);
 
     /* stop precording video. */
     [Throws]
     void stopRecording();
 
     /* get a media stream to be used as a camera viewfinder; the options
        define the desired frame size of the preview, chosen from
        capabilities.previewSizes, e.g.:
@@ -188,8 +188,54 @@ interface CameraControl {
        the callbacks are optional, unless you really need to know when
        the hardware is ultimately released.
 
        once this is called, the camera control object is to be considered
        defunct; a new instance will need to be created to access the camera. */
     [Throws]
     void release(optional CameraReleaseCallback onSuccess, optional CameraErrorCallback onError);
 };
+/* 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 = 0;
+    long long maxFileSizeBytes = 0;
+    long long maxVideoLengthMs = 0;
+};
+
+/* 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 = 0;
+};
deleted file mode 100644
--- a/dom/wifi/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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