Backed out changeset 23b18c4d6f6a (bug 994912) for suspecion of causing m3 test failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 25 Sep 2014 12:44:50 +0200
changeset 207227 4c80ec2e0d494c14a898afadffb4adfe2126faf8
parent 207226 6850e4bf564cb7c6e630361fe44d46357c281cb6
child 207228 5e008b35559339ea674b78929c1cb5ba1b63878a
push id8995
push userryanvm@gmail.com
push dateThu, 25 Sep 2014 20:57:55 +0000
treeherderfx-team@bcd0d2b817a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs994912
milestone35.0a1
backs out23b18c4d6f6a6fb8c88567783e4e4f42fecff0dc
Backed out changeset 23b18c4d6f6a (bug 994912) for suspecion of causing m3 test failures
content/base/public/nsHostObjectProtocolHandler.h
content/base/src/nsHostObjectProtocolHandler.cpp
content/html/content/public/HTMLMediaElement.h
content/html/content/src/HTMLMediaElement.cpp
content/media/DOMMediaStream.cpp
content/media/DOMMediaStream.h
content/media/webspeech/recognition/SpeechRecognition.cpp
dom/interfaces/html/nsIDOMHTMLMediaElement.idl
dom/media/bridge/IPeerConnection.idl
dom/media/moz.build
dom/media/nsIDOMMediaStream.idl
dom/media/nsIDOMNavigatorUserMedia.idl
dom/webidl/MediaStream.webidl
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
media/webrtc/signaling/test/FakeMediaStreams.h
media/webrtc/signaling/test/FakeMediaStreamsImpl.h
media/webrtc/signaling/test/FakePCObserver.h
media/webrtc/signaling/test/signaling_unittests.cpp
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
--- a/content/base/public/nsHostObjectProtocolHandler.h
+++ b/content/base/public/nsHostObjectProtocolHandler.h
@@ -13,20 +13,20 @@
 
 #define BLOBURI_SCHEME "blob"
 #define MEDIASTREAMURI_SCHEME "mediastream"
 #define MEDIASOURCEURI_SCHEME "mediasource"
 #define FONTTABLEURI_SCHEME "moz-fonttable"
 #define RTSPURI_SCHEME "rtsp"
 
 class nsIDOMBlob;
+class nsIDOMMediaStream;
 class nsIPrincipal;
 
 namespace mozilla {
-class DOMMediaStream;
 namespace dom {
 class MediaSource;
 }
 }
 
 class nsHostObjectProtocolHandler : public nsIProtocolHandler
 {
 public:
@@ -117,17 +117,17 @@ inline bool IsFontTableURI(nsIURI* aUri)
   bool isFont;
   return NS_SUCCEEDED(aUri->SchemeIs(FONTTABLEURI_SCHEME, &isFont)) && isFont;
 }
 
 extern nsresult
 NS_GetStreamForBlobURI(nsIURI* aURI, nsIInputStream** aStream);
 
 extern nsresult
-NS_GetStreamForMediaStreamURI(nsIURI* aURI, mozilla::DOMMediaStream** aStream);
+NS_GetStreamForMediaStreamURI(nsIURI* aURI, nsIDOMMediaStream** aStream);
 
 extern nsresult
 NS_GetSourceForMediaSourceURI(nsIURI* aURI, mozilla::dom::MediaSource** aSource);
 
 #define NS_BLOBPROTOCOLHANDLER_CID \
 { 0xb43964aa, 0xa078, 0x44b2, \
   { 0xb0, 0x6b, 0xfd, 0x4d, 0x1b, 0x17, 0x2e, 0x66 } }
 
--- a/content/base/src/nsHostObjectProtocolHandler.cpp
+++ b/content/base/src/nsHostObjectProtocolHandler.cpp
@@ -6,30 +6,30 @@
 
 #include "nsHostObjectProtocolHandler.h"
 #include "nsHostObjectURI.h"
 #include "nsError.h"
 #include "nsClassHashtable.h"
 #include "nsNetUtil.h"
 #include "nsIPrincipal.h"
 #include "nsDOMFile.h"
-#include "DOMMediaStream.h"
+#include "nsIDOMMediaStream.h"
 #include "mozilla/dom/MediaSource.h"
 #include "nsIMemoryReporter.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/LoadInfo.h"
 
 using mozilla::dom::DOMFileImpl;
 using mozilla::LoadInfo;
 
 // -----------------------------------------------------------------------
 // Hash table
 struct DataInfo
 {
-  // mObject is expected to be an nsIDOMBlob, DOMMediaStream, or MediaSource
+  // mObject is expected to be an nsIDOMBlob, nsIDOMMediaStream, or MediaSource
   nsCOMPtr<nsISupports> mObject;
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCString mStack;
 };
 
 static nsClassHashtable<nsCStringHashKey, DataInfo>* gDataTable;
 
 // Memory reporting for the hash table.
@@ -600,27 +600,30 @@ NS_GetStreamForBlobURI(nsIURI* aURI, nsI
     return NS_ERROR_DOM_BAD_URI;
   }
 
   DOMFileImpl* blob = static_cast<DOMFileImpl*>(blobImpl.get());
   return blob->GetInternalStream(aStream);
 }
 
 nsresult
-NS_GetStreamForMediaStreamURI(nsIURI* aURI, mozilla::DOMMediaStream** aStream)
+NS_GetStreamForMediaStreamURI(nsIURI* aURI, nsIDOMMediaStream** aStream)
 {
   NS_ASSERTION(IsMediaStreamURI(aURI), "Only call this with mediastream URIs");
 
   *aStream = nullptr;
 
-  nsresult rv = CallQueryInterface(GetDataObject(aURI), aStream);
-  if (NS_FAILED(rv)) {
+  nsCOMPtr<nsIDOMMediaStream> stream = do_QueryInterface(GetDataObject(aURI));
+  if (!stream) {
     return NS_ERROR_DOM_BAD_URI;
   }
-  return rv;
+
+  *aStream = stream;
+  NS_ADDREF(*aStream);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsFontTableProtocolHandler::NewURI(const nsACString& aSpec,
                                    const char *aCharset,
                                    nsIURI *aBaseURI,
                                    nsIURI **aResult)
 {
--- a/content/html/content/public/HTMLMediaElement.h
+++ b/content/html/content/public/HTMLMediaElement.h
@@ -522,17 +522,16 @@ public:
   void SetMozIsCasting(bool aShow)
   {
     mIsCasting = aShow;
   }
 
   already_AddRefed<DOMMediaStream> GetMozSrcObject() const;
 
   void SetMozSrcObject(DOMMediaStream& aValue);
-  void SetMozSrcObject(DOMMediaStream* aValue);
 
   bool MozPreservesPitch() const
   {
     return mPreservesPitch;
   }
 
   // XPCOM MozPreservesPitch() is OK
 
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -504,27 +504,37 @@ already_AddRefed<DOMMediaStream>
 HTMLMediaElement::GetMozSrcObject() const
 {
   NS_ASSERTION(!mSrcAttrStream || mSrcAttrStream->GetStream(),
                "MediaStream should have been set up properly");
   nsRefPtr<DOMMediaStream> stream = mSrcAttrStream;
   return stream.forget();
 }
 
+NS_IMETHODIMP
+HTMLMediaElement::GetMozSrcObject(nsIDOMMediaStream** aStream)
+{
+  nsRefPtr<DOMMediaStream> stream = GetMozSrcObject();
+  stream.forget(aStream);
+  return NS_OK;
+}
+
 void
 HTMLMediaElement::SetMozSrcObject(DOMMediaStream& aValue)
 {
   mSrcAttrStream = &aValue;
   Load();
 }
 
-void
-HTMLMediaElement::SetMozSrcObject(DOMMediaStream* aValue)
+NS_IMETHODIMP
+HTMLMediaElement::SetMozSrcObject(nsIDOMMediaStream* aStream)
 {
-  SetMozSrcObject(*aValue);
+  DOMMediaStream* stream = static_cast<DOMMediaStream*>(aStream);
+  SetMozSrcObject(*stream);
+  return NS_OK;
 }
 
 /* readonly attribute nsIDOMHTMLMediaElement mozAutoplayEnabled; */
 NS_IMETHODIMP HTMLMediaElement::GetMozAutoplayEnabled(bool *aAutoplayEnabled)
 {
   *aAutoplayEnabled = mAutoplayEnabled;
 
   return NS_OK;
@@ -1129,27 +1139,27 @@ nsresult HTMLMediaElement::LoadResource(
   if (other && other->mDecoder) {
     // Clone it.
     nsresult rv = InitializeDecoderAsClone(other->mDecoder);
     if (NS_SUCCEEDED(rv))
       return rv;
   }
 
   if (IsMediaStreamURI(mLoadingSrc)) {
-    nsRefPtr<DOMMediaStream> stream;
+    nsCOMPtr<nsIDOMMediaStream> stream;
     rv = NS_GetStreamForMediaStreamURI(mLoadingSrc, getter_AddRefs(stream));
     if (NS_FAILED(rv)) {
       nsCString specUTF8;
       mLoadingSrc->GetSpec(specUTF8);
       NS_ConvertUTF8toUTF16 spec(specUTF8);
       const char16_t* params[] = { spec.get() };
       ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
       return rv;
     }
-    SetupSrcMediaStreamPlayback(stream);
+    SetupSrcMediaStreamPlayback(static_cast<DOMMediaStream*>(stream.get()));
     return NS_OK;
   }
 
   if (IsMediaSourceURI(mLoadingSrc)) {
     nsRefPtr<MediaSource> source;
     rv = NS_GetSourceForMediaSourceURI(mLoadingSrc, getter_AddRefs(source));
     if (NS_FAILED(rv)) {
       nsCString specUTF8;
@@ -1858,28 +1868,42 @@ HTMLMediaElement::MozCaptureStream(Error
   if (!stream) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   return stream.forget();
 }
 
+NS_IMETHODIMP HTMLMediaElement::MozCaptureStream(nsIDOMMediaStream** aStream)
+{
+  ErrorResult rv;
+  *aStream = MozCaptureStream(rv).take();
+  return rv.ErrorCode();
+}
+
 already_AddRefed<DOMMediaStream>
 HTMLMediaElement::MozCaptureStreamUntilEnded(ErrorResult& aRv)
 {
   nsRefPtr<DOMMediaStream> stream = CaptureStreamInternal(true);
   if (!stream) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   return stream.forget();
 }
 
+NS_IMETHODIMP HTMLMediaElement::MozCaptureStreamUntilEnded(nsIDOMMediaStream** aStream)
+{
+  ErrorResult rv;
+  *aStream = MozCaptureStreamUntilEnded(rv).take();
+  return rv.ErrorCode();
+}
+
 NS_IMETHODIMP HTMLMediaElement::GetMozAudioCaptured(bool* aCaptured)
 {
   *aCaptured = MozAudioCaptured();
   return NS_OK;
 }
 
 class MediaElementSetForURI : public nsURIHashKey {
 public:
--- a/content/media/DOMMediaStream.cpp
+++ b/content/media/DOMMediaStream.cpp
@@ -14,30 +14,44 @@
 #include "mozilla/dom/VideoTrackList.h"
 #include "MediaStreamGraph.h"
 #include "AudioStreamTrack.h"
 #include "VideoStreamTrack.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED(DOMMediaStream,
-                                   DOMEventTargetHelper,
-                                   mWindow,
-                                   mTracks,
-                                   mConsumersToKeepAlive);
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMMediaStream)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
+  NS_INTERFACE_MAP_ENTRY(nsIDOMMediaStream)
+NS_INTERFACE_MAP_END
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMMediaStream)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMMediaStream)
+
+NS_IMPL_CYCLE_COLLECTION_CLASS(DOMMediaStream)
 
-NS_IMPL_ADDREF_INHERITED(DOMMediaStream, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(DOMMediaStream, DOMEventTargetHelper)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMMediaStream)
+  tmp->Destroy();
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mTracks)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mConsumersToKeepAlive)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
+NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMMediaStream)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTracks)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConsumersToKeepAlive)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(DOMMediaStream)
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMMediaStream)
-  NS_INTERFACE_MAP_ENTRY(DOMMediaStream)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-NS_IMPL_ISUPPORTS_INHERITED0(DOMLocalMediaStream, DOMMediaStream)
+NS_IMPL_ISUPPORTS_INHERITED(DOMLocalMediaStream, DOMMediaStream,
+                            nsIDOMLocalMediaStream)
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream,
                                    mStreamNode)
 
 NS_IMPL_ADDREF_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
 NS_IMPL_RELEASE_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMAudioNodeMediaStream)
@@ -74,22 +88,18 @@ public:
       nsRefPtr<MediaStreamTrack> track;
       if (mEvents & MediaStreamListener::TRACK_EVENT_CREATED) {
         track = stream->CreateDOMTrack(mID, mType);
         stream->NotifyMediaStreamTrackCreated(track);
       } else {
         track = stream->GetDOMTrackFor(mID);
       }
       if (mEvents & MediaStreamListener::TRACK_EVENT_ENDED) {
-        if (track) {
-          track->NotifyEnded();
-          stream->NotifyMediaStreamTrackEnded(track);
-        } else {
-          NS_ERROR("track ended but not found");
-        }
+        track->NotifyEnded();
+        stream->NotifyMediaStreamTrackEnded(track);
       }
       return NS_OK;
     }
 
     StreamTime mEndTime;
     nsRefPtr<StreamListener> mListener;
     TrackID mID;
     uint32_t mEvents;
--- a/content/media/DOMMediaStream.h
+++ b/content/media/DOMMediaStream.h
@@ -1,23 +1,23 @@
 /* -*- Mode: C++; 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/. */
 
 #ifndef NSDOMMEDIASTREAM_H_
 #define NSDOMMEDIASTREAM_H_
 
+#include "nsIDOMMediaStream.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "StreamBuffer.h"
 #include "nsIDOMWindow.h"
 #include "nsIPrincipal.h"
 #include "mozilla/PeerIdentity.h"
-#include "mozilla/DOMEventTargetHelper.h"
 
 class nsXPCClassInfo;
 
 // GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
 // GetTickCount() and conflicts with NS_DECL_NSIDOMMEDIASTREAM, containing
 // currentTime getter.
 #ifdef GetCurrentTime
 #undef GetCurrentTime
@@ -43,45 +43,39 @@ class AudioTrack;
 class VideoTrack;
 class AudioTrackList;
 class VideoTrackList;
 class MediaTrackListListener;
 }
 
 class MediaStreamDirectListener;
 
-#define NS_DOMMEDIASTREAM_IID \
-{ 0x8cb65468, 0x66c0, 0x444e, \
-  { 0x89, 0x9f, 0x89, 0x1d, 0x9e, 0xd2, 0xbe, 0x7c } }
-
 /**
  * DOM wrapper for MediaStreams.
  */
-class DOMMediaStream : public DOMEventTargetHelper
+class DOMMediaStream : public nsIDOMMediaStream,
+                       public nsWrapperCache
 {
   friend class DOMLocalMediaStream;
   typedef dom::MediaStreamTrack MediaStreamTrack;
   typedef dom::AudioStreamTrack AudioStreamTrack;
   typedef dom::VideoStreamTrack VideoStreamTrack;
   typedef dom::AudioTrack AudioTrack;
   typedef dom::VideoTrack VideoTrack;
   typedef dom::AudioTrackList AudioTrackList;
   typedef dom::VideoTrackList VideoTrackList;
   typedef dom::MediaTrackListListener MediaTrackListListener;
 
 public:
   typedef uint8_t TrackTypeHints;
 
   DOMMediaStream();
 
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMMediaStream,
-                                           DOMEventTargetHelper)
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMMEDIASTREAM_IID)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMMediaStream)
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   nsIDOMWindow* GetParentObject() const
   {
     return mWindow;
   }
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   // WebIDL
@@ -294,30 +288,23 @@ private:
   // If null, this stream can be used by anyone because it has no content yet.
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsTArray<PrincipalChangeObserver*> mPrincipalChangeObservers;
   // this is used in gUM and WebRTC to identify peers that this stream
   // is allowed to be sent to
   nsAutoPtr<PeerIdentity> mPeerIdentity;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(DOMMediaStream,
-                              NS_DOMMEDIASTREAM_IID)
-
-#define NS_DOMLOCALMEDIASTREAM_IID \
-{ 0xb1437260, 0xec61, 0x4dfa, \
-  { 0x92, 0x54, 0x04, 0x44, 0xe2, 0xb5, 0x94, 0x9c } }
-
-class DOMLocalMediaStream : public DOMMediaStream
+class DOMLocalMediaStream : public DOMMediaStream,
+                            public nsIDOMLocalMediaStream
 {
 public:
   DOMLocalMediaStream() {}
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMLOCALMEDIASTREAM_IID)
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   virtual void Stop();
 
   virtual MediaEngineSource* GetMediaEngine(TrackID aTrackID) { return nullptr; }
 
   /**
@@ -331,19 +318,16 @@ public:
    */
   static already_AddRefed<DOMLocalMediaStream>
   CreateTrackUnionStream(nsIDOMWindow* aWindow, TrackTypeHints aHintContents = 0);
 
 protected:
   virtual ~DOMLocalMediaStream();
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(DOMLocalMediaStream,
-                              NS_DOMLOCALMEDIASTREAM_IID)
-
 class DOMAudioNodeMediaStream : public DOMMediaStream
 {
   typedef dom::AudioNode AudioNode;
 public:
   explicit DOMAudioNodeMediaStream(AudioNode* aNode);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
--- a/content/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/content/media/webspeech/recognition/SpeechRecognition.cpp
@@ -930,21 +930,18 @@ SpeechEvent::Run()
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(SpeechRecognition::GetUserMediaSuccessCallback, nsIDOMGetUserMediaSuccessCallback)
 
 NS_IMETHODIMP
 SpeechRecognition::GetUserMediaSuccessCallback::OnSuccess(nsISupports* aStream)
 {
-  DOMLocalMediaStream *localStream = nullptr;
-  nsresult rv = CallQueryInterface(aStream, &localStream);
-  if (NS_SUCCEEDED(rv)) {
-    mRecognition->StartRecording(localStream);
-  }
+  nsCOMPtr<nsIDOMLocalMediaStream> localStream = do_QueryInterface(aStream);
+  mRecognition->StartRecording(static_cast<DOMLocalMediaStream*>(localStream.get()));
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(SpeechRecognition::GetUserMediaErrorCallback, nsIDOMGetUserMediaErrorCallback)
 
 NS_IMETHODIMP
 SpeechRecognition::GetUserMediaErrorCallback::OnError(const nsAString& aError)
 {
--- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
@@ -3,16 +3,18 @@
 /* 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 "nsIDOMHTMLElement.idl"
 #include "nsIDOMMediaError.idl"
 #include "nsIDOMTimeRanges.idl"
 
+interface nsIDOMMediaStream;
+
 /**
  * The nsIDOMHTMLMediaElement interface is an interface to be implemented by the HTML
  * <audio> and <video> elements.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#htmlmediaelement
  *
  * @status UNDER_DEVELOPMENT
@@ -28,16 +30,17 @@
 [uuid(c041d76c-15ce-47ad-b61d-e8755a6db638)]
 interface nsIDOMHTMLMediaElement : nsISupports
 {
   // error state
   readonly attribute nsIDOMMediaError error;
 
   // network state
            attribute DOMString src;
+           attribute nsIDOMMediaStream mozSrcObject;
   readonly attribute DOMString currentSrc;
   const unsigned short NETWORK_EMPTY = 0;
   const unsigned short NETWORK_IDLE = 1;
   const unsigned short NETWORK_LOADING = 2;
   const unsigned short NETWORK_NO_SOURCE = 3;
   readonly attribute unsigned short networkState;
            attribute DOMString preload;
   readonly attribute nsIDOMTimeRanges buffered;
@@ -71,16 +74,18 @@ interface nsIDOMHTMLMediaElement : nsISu
 
   // controls
            attribute boolean controls;
            attribute double volume;
            attribute boolean muted;
            attribute boolean defaultMuted;
 
   // Mozilla extension: stream capture
+  nsIDOMMediaStream mozCaptureStream();
+  nsIDOMMediaStream mozCaptureStreamUntilEnded();
   readonly attribute boolean mozAudioCaptured;
 
   // Mozilla extension: return embedded metadata from the stream as a
   // JSObject with key:value pairs for each tag. This can be used by
   // player interfaces to display the song title, artist, etc.
   [implicit_jscontext]
   jsval mozGetMetadata();
 
--- a/dom/media/bridge/IPeerConnection.idl
+++ b/dom/media/bridge/IPeerConnection.idl
@@ -1,12 +1,13 @@
 #include "nsIThread.idl"
 #include "nsIDOMWindow.idl"
 #include "nsIPropertyBag2.idl"
 
+interface nsIDOMMediaStream;
 interface nsIDOMDataChannel;
 
 /*
  * Manager interface to PeerConnection.js so it is accessible from C++.
  */
 [scriptable, uuid(c2218bd2-2648-4701-8fa6-305d3379e9f8)]
 interface IPeerConnectionManager : nsISupports
 {
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -12,16 +12,17 @@ if CONFIG['MOZ_WEBRTC']:
         '/media/webrtc/signaling/src/common',
         '/media/webrtc/trunk',
     ]
 
     MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
     WEBRTC_SIGNALLING_TEST_MANIFESTS += ['tests/mochitest/steeplechase.ini']
 
 XPIDL_SOURCES += [
+    'nsIDOMMediaStream.idl',
     'nsIDOMNavigatorUserMedia.idl',
     'nsIMediaManager.idl',
 ]
 
 XPIDL_MODULE = 'dom_media'
 
 EXPORTS.mozilla.dom += [
     'GetUserMediaRequest.h',
new file mode 100644
--- /dev/null
+++ b/dom/media/nsIDOMMediaStream.idl
@@ -0,0 +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/. */
+
+#include "nsISupports.idl"
+
+// undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
+%{C++
+#ifdef GetCurrentTime
+#undef GetCurrentTime
+#endif
+%}
+
+[builtinclass, uuid(3ef760bb-ff19-4dbb-b552-af27ab84b9b8)]
+interface nsIDOMMediaStream : nsISupports
+{
+  /* Placeholder interface only; will be removed after further WebIDL conversion.
+     Do not add anything here. */
+};
+
+[builtinclass, uuid(dd37150a-9823-4605-ac4c-3516629a8aaf)]
+interface nsIDOMLocalMediaStream : nsIDOMMediaStream
+{
+  /* Placeholder interface only; will be removed after further WebIDL conversion.
+     Do not add anything here. */
+};
--- a/dom/media/nsIDOMNavigatorUserMedia.idl
+++ b/dom/media/nsIDOMNavigatorUserMedia.idl
@@ -1,14 +1,15 @@
 /* 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 "nsISupports.idl"
 #include "nsIVariant.idl"
+#include "nsIDOMMediaStream.idl"
 
 [scriptable, builtinclass, uuid(4af2bdb7-1547-4d10-8886-02a78c3c0b83)]
 interface nsIMediaDevice : nsISupports
 {
   readonly attribute DOMString type;
   readonly attribute DOMString name;
   readonly attribute DOMString id;
   readonly attribute DOMString facingMode;
@@ -21,17 +22,17 @@ interface nsIGetUserMediaDevicesSuccessC
   void onSuccess(in nsIVariant devices);
 };
 
 [scriptable, function, uuid(f2a144fc-3534-4761-8c5d-989ae720f89a)]
 interface nsIDOMGetUserMediaSuccessCallback : nsISupports
 {
   /*
    * value must be a nsIDOMBlob if picture is true and a
-   * DOMLocalMediaStream if either audio or video are true.
+   * nsIDOMLocalMediaStream if either audio or video are true.
    */
   void onSuccess(in nsISupports value);
 };
 
 [scriptable, function, uuid(2614bbcf-85cc-43e5-8740-964f52bdc7ca)]
 interface nsIDOMGetUserMediaErrorCallback : nsISupports
 {
   void onError(in DOMString error);
--- a/dom/webidl/MediaStream.webidl
+++ b/dom/webidl/MediaStream.webidl
@@ -16,17 +16,17 @@
 dictionary MediaStreamConstraints {
     (boolean or MediaTrackConstraints) audio = false;
     (boolean or MediaTrackConstraints) video = false;
     boolean picture = false; // Mozilla legacy
     boolean fake = false;    // for testing
     DOMString? peerIdentity = null;
 };
 
-interface MediaStream : EventTarget {
+interface MediaStream {
     // readonly attribute DOMString    id;
     sequence<AudioStreamTrack> getAudioTracks();
     sequence<VideoStreamTrack> getVideoTracks();
     sequence<MediaStreamTrack> getTracks();
     // MediaStreamTrack           getTrackById (DOMString trackId);
     // void                       addTrack (MediaStreamTrack track);
     // void                       removeTrack (MediaStreamTrack track);
     //         attribute boolean      ended;
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -698,17 +698,17 @@ PeerConnectionImpl::GetFingerprintHexVal
   if (NS_SUCCEEDED(FingerprintSplitHelper(fp, spc))) {
     return fp.substr(spc + 1);
   }
   return "";
 }
 
 
 nsresult
-PeerConnectionImpl::CreateFakeMediaStream(uint32_t aHint, DOMMediaStream** aRetval)
+PeerConnectionImpl::CreateFakeMediaStream(uint32_t aHint, nsIDOMMediaStream** aRetval)
 {
   MOZ_ASSERT(aRetval);
   PC_AUTO_ENTER_API_CALL(false);
 
   bool mute = false;
 
   // Hack to allow you to mute the stream
   if (aHint & MEDIA_STREAM_MUTE) {
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -49,16 +49,17 @@ class AFakePCObserver;
 }
 
 #ifdef USE_FAKE_MEDIA_STREAMS
 class Fake_DOMMediaStream;
 class Fake_MediaStreamTrack;
 #endif
 
 class nsGlobalWindow;
+class nsIDOMMediaStream;
 class nsDOMDataChannel;
 
 namespace mozilla {
 class DataChannel;
 class DtlsIdentity;
 class NrIceCtx;
 class NrIceMediaStream;
 class NrIceStunServer;
@@ -283,17 +284,17 @@ public:
 
   // Get the DTLS identity (local side)
   mozilla::RefPtr<DtlsIdentity> const GetIdentity() const;
   std::string GetFingerprint() const;
   std::string GetFingerprintAlgorithm() const;
   std::string GetFingerprintHexValue() const;
 
   // Create a fake media stream
-  nsresult CreateFakeMediaStream(uint32_t hint, mozilla::DOMMediaStream** retval);
+  nsresult CreateFakeMediaStream(uint32_t hint, nsIDOMMediaStream** retval);
 
   nsPIDOMWindow* GetWindow() const {
     PC_AUTO_ENTER_API_CALL_NO_CHECK();
     return mWindow;
   }
 
   // Initialize PeerConnection from an IceConfiguration object (unit-tests)
   nsresult Initialize(PeerConnectionObserver& aObserver,
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -290,27 +290,29 @@ nsresult PeerConnectionMedia::Init(const
   // figure out how to report that StartGathering failed. Bug 827982.
   RUN_ON_THREAD(mIceCtx->thread(),
                 WrapRunnable(mIceCtx, &NrIceCtx::StartGathering), NS_DISPATCH_NORMAL);
 
   return NS_OK;
 }
 
 nsresult
-PeerConnectionMedia::AddStream(DOMMediaStream* aMediaStream,
+PeerConnectionMedia::AddStream(nsIDOMMediaStream* aMediaStream,
                                uint32_t hints,
                                uint32_t *stream_id)
 {
   ASSERT_ON_THREAD(mMainThread);
 
   if (!aMediaStream) {
     CSFLogError(logTag, "%s - aMediaStream is NULL", __FUNCTION__);
     return NS_ERROR_FAILURE;
   }
 
+  DOMMediaStream* stream = static_cast<DOMMediaStream*>(aMediaStream);
+
   CSFLogDebug(logTag, "%s: MediaStream: %p", __FUNCTION__, aMediaStream);
 
   // Adding tracks here based on nsDOMMediaStream expectation settings
 #ifdef MOZILLA_INTERNAL_API
   if (!Preferences::GetBool("media.peerconnection.video.enabled", true)) {
     hints &= ~(DOMMediaStream::HINT_CONTENTS_VIDEO);
   }
 #endif
@@ -329,52 +331,54 @@ PeerConnectionMedia::AddStream(DOMMediaS
 
   for (uint32_t u = 0; u < mLocalSourceStreams.Length(); u++) {
     auto& lss = mLocalSourceStreams[u];
     if (((hints & DOMMediaStream::HINT_CONTENTS_AUDIO) && lss->AudioTrackCount()) ||
         ((hints & DOMMediaStream::HINT_CONTENTS_VIDEO) && lss->VideoTrackCount())) {
       CSFLogError(logTag, "Only one stream of any given type allowed");
       return NS_ERROR_FAILURE;
     }
-    if (aMediaStream == lss->GetMediaStream()) {
+    if (stream == lss->GetMediaStream()) {
       localSourceStream = lss;
       *stream_id = u;
       break;
     }
   }
   if (!localSourceStream) {
-    localSourceStream = new LocalSourceStreamInfo(aMediaStream, this);
+    localSourceStream = new LocalSourceStreamInfo(stream, this);
     mLocalSourceStreams.AppendElement(localSourceStream);
     *stream_id = mLocalSourceStreams.Length() - 1;
   }
 
   if (hints & DOMMediaStream::HINT_CONTENTS_AUDIO) {
     localSourceStream->ExpectAudio(TRACK_AUDIO);
   }
 
   if (hints & DOMMediaStream::HINT_CONTENTS_VIDEO) {
     localSourceStream->ExpectVideo(TRACK_VIDEO);
   }
   return NS_OK;
 }
 
 nsresult
-PeerConnectionMedia::RemoveStream(DOMMediaStream* aMediaStream,
+PeerConnectionMedia::RemoveStream(nsIDOMMediaStream* aMediaStream,
                                   uint32_t hints,
                                   uint32_t *stream_id)
 {
   MOZ_ASSERT(aMediaStream);
   ASSERT_ON_THREAD(mMainThread);
 
+  DOMMediaStream* stream = static_cast<DOMMediaStream*>(aMediaStream);
+
   CSFLogDebug(logTag, "%s: MediaStream: %p",
     __FUNCTION__, aMediaStream);
 
   for (uint32_t u = 0; u < mLocalSourceStreams.Length(); u++) {
     nsRefPtr<LocalSourceStreamInfo> localSourceStream = mLocalSourceStreams[u];
-    if (localSourceStream->GetMediaStream() == aMediaStream) {
+    if (localSourceStream->GetMediaStream() == stream) {
       *stream_id = u;
 
       if (hints & DOMMediaStream::HINT_CONTENTS_AUDIO) {
         localSourceStream->RemoveAudio(TRACK_AUDIO);
       }
       if (hints & DOMMediaStream::HINT_CONTENTS_VIDEO) {
         localSourceStream->RemoveAudio(TRACK_VIDEO);
       }
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
@@ -307,21 +307,21 @@ class PeerConnectionMedia : public sigsl
     return mIceStreams[i];
   }
 
   size_t num_ice_media_streams() const {
     return mIceStreams.size();
   }
 
   // Add a stream (main thread only)
-  nsresult AddStream(DOMMediaStream* aMediaStream, uint32_t hints,
+  nsresult AddStream(nsIDOMMediaStream* aMediaStream, uint32_t hints,
                      uint32_t *stream_id);
 
   // Remove a stream (main thread only)
-  nsresult RemoveStream(DOMMediaStream* aMediaStream,
+  nsresult RemoveStream(nsIDOMMediaStream* aMediaStream,
                         uint32_t hints,
                         uint32_t *stream_id);
 
   // Get a specific local stream
   uint32_t LocalStreamsLength()
   {
     return mLocalSourceStreams.Length();
   }
--- a/media/webrtc/signaling/test/FakeMediaStreams.h
+++ b/media/webrtc/signaling/test/FakeMediaStreams.h
@@ -17,16 +17,17 @@
 #include "mozilla/Mutex.h"
 #include "mozilla/RefPtr.h"
 #include "AudioSegment.h"
 #include "MediaSegment.h"
 #include "StreamBuffer.h"
 #include "nsTArray.h"
 #include "nsIRunnable.h"
 #include "nsISupportsImpl.h"
+#include "nsIDOMMediaStream.h"
 
 class nsIDOMWindow;
 
 namespace mozilla {
    class MediaStreamGraph;
    class MediaSegment;
 };
 
@@ -226,17 +227,17 @@ public:
   const Fake_MediaStreamTrack* AsAudioStreamTrack() const
   {
     return mIsVideo? nullptr : this;
   }
 private:
   const bool mIsVideo;
 };
 
-class Fake_DOMMediaStream : public nsISupports
+class Fake_DOMMediaStream : public nsIDOMMediaStream
 {
 protected:
   virtual ~Fake_DOMMediaStream() {
     // Note: memory leak
     mMediaStream->Stop();
   }
 
 public:
--- a/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
+++ b/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
@@ -12,17 +12,17 @@
 
 void LogTime(AsyncLatencyLogger::LatencyLogIndex index, uint64_t b, int64_t c) {}
 void LogLatency(AsyncLatencyLogger::LatencyLogIndex index, uint64_t b, int64_t c) {}
 
 static const int AUDIO_BUFFER_SIZE = 1600;
 static const int NUM_CHANNELS      = 2;
 static const int GRAPH_RATE        = 16000;
 
-NS_IMPL_ISUPPORTS0(Fake_DOMMediaStream)
+NS_IMPL_ISUPPORTS(Fake_DOMMediaStream, nsIDOMMediaStream)
 
 // Fake_MediaStream
 double Fake_MediaStream::StreamTimeToSeconds(mozilla::StreamTime aTime) {
   return static_cast<double>(aTime)/GRAPH_RATE;
 }
 
 mozilla::StreamTime
 Fake_MediaStream::TicksToTimeRoundDown(mozilla::TrackRate aRate,
--- a/media/webrtc/signaling/test/FakePCObserver.h
+++ b/media/webrtc/signaling/test/FakePCObserver.h
@@ -13,16 +13,17 @@
 
 #include "mozilla/Mutex.h"
 #include "AudioSegment.h"
 #include "MediaSegment.h"
 #include "StreamBuffer.h"
 #include "nsTArray.h"
 #include "nsIRunnable.h"
 #include "nsISupportsImpl.h"
+#include "nsIDOMMediaStream.h"
 #include "mozilla/dom/PeerConnectionObserverEnumsBinding.h"
 #include "PeerConnectionImpl.h"
 #include "nsWeakReference.h"
 
 namespace sipcc {
 class PeerConnectionImpl;
 }
 
@@ -74,17 +75,17 @@ public:
   virtual NS_IMETHODIMP OnCreateAnswerError(uint32_t code, const char *msg, ER&) = 0;
   virtual NS_IMETHODIMP OnSetLocalDescriptionSuccess(ER&) = 0;
   virtual NS_IMETHODIMP OnSetRemoteDescriptionSuccess(ER&) = 0;
   virtual NS_IMETHODIMP OnSetLocalDescriptionError(uint32_t code, const char *msg, ER&) = 0;
   virtual NS_IMETHODIMP OnSetRemoteDescriptionError(uint32_t code, const char *msg, ER&) = 0;
   virtual NS_IMETHODIMP NotifyDataChannel(nsIDOMDataChannel *channel, ER&) = 0;
   virtual NS_IMETHODIMP OnStateChange(mozilla::dom::PCObserverStateType state_type, ER&,
                                       void* = nullptr) = 0;
-  virtual NS_IMETHODIMP OnAddStream(mozilla::DOMMediaStream *stream, ER&) = 0;
+  virtual NS_IMETHODIMP OnAddStream(nsIDOMMediaStream *stream, ER&) = 0;
   virtual NS_IMETHODIMP OnRemoveStream(ER&) = 0;
   virtual NS_IMETHODIMP OnAddTrack(ER&) = 0;
   virtual NS_IMETHODIMP OnRemoveTrack(ER&) = 0;
   virtual NS_IMETHODIMP OnReplaceTrackSuccess(ER&) = 0;
   virtual NS_IMETHODIMP OnReplaceTrackError(uint32_t code, const char *msg, ER&) = 0;
   virtual NS_IMETHODIMP OnAddIceCandidateSuccess(ER&) = 0;
   virtual NS_IMETHODIMP OnAddIceCandidateError(uint32_t code, const char *msg, ER&) = 0;
   virtual NS_IMETHODIMP OnIceCandidate(uint16_t level, const char *mid,
--- a/media/webrtc/signaling/test/signaling_unittests.cpp
+++ b/media/webrtc/signaling/test/signaling_unittests.cpp
@@ -264,17 +264,17 @@ public:
   NS_IMETHODIMP OnCreateAnswerSuccess(const char* answer, ER&);
   NS_IMETHODIMP OnCreateAnswerError(uint32_t code, const char *msg, ER&);
   NS_IMETHODIMP OnSetLocalDescriptionSuccess(ER&);
   NS_IMETHODIMP OnSetRemoteDescriptionSuccess(ER&);
   NS_IMETHODIMP OnSetLocalDescriptionError(uint32_t code, const char *msg, ER&);
   NS_IMETHODIMP OnSetRemoteDescriptionError(uint32_t code, const char *msg, ER&);
   NS_IMETHODIMP NotifyDataChannel(nsIDOMDataChannel *channel, ER&);
   NS_IMETHODIMP OnStateChange(PCObserverStateType state_type, ER&, void*);
-  NS_IMETHODIMP OnAddStream(DOMMediaStream *stream, ER&);
+  NS_IMETHODIMP OnAddStream(nsIDOMMediaStream *stream, ER&);
   NS_IMETHODIMP OnRemoveStream(ER&);
   NS_IMETHODIMP OnAddTrack(ER&);
   NS_IMETHODIMP OnRemoveTrack(ER&);
   NS_IMETHODIMP OnReplaceTrackSuccess(ER&);
   NS_IMETHODIMP OnReplaceTrackError(uint32_t code, const char *msg, ER&);
   NS_IMETHODIMP OnAddIceCandidateSuccess(ER&);
   NS_IMETHODIMP OnAddIceCandidateError(uint32_t code, const char *msg, ER&);
   NS_IMETHODIMP OnIceCandidate(uint16_t level, const char *mid, const char *cand, ER&);
@@ -424,31 +424,33 @@ TestObserver::OnStateChange(PCObserverSt
   }
 
   lastStateType = state_type;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-TestObserver::OnAddStream(DOMMediaStream *stream, ER&)
+TestObserver::OnAddStream(nsIDOMMediaStream *stream, ER&)
 {
   PR_ASSERT(stream);
 
-  std::cout << name << ": OnAddStream called hints=" << stream->GetHintContents()
+  DOMMediaStream *ms = static_cast<DOMMediaStream *>(stream);
+
+  std::cout << name << ": OnAddStream called hints=" << ms->GetHintContents()
             << " thread=" << PR_GetCurrentThread() << std::endl ;
 
   onAddStreamCalled = true;
 
-  streams.push_back(stream);
+  streams.push_back(ms);
 
   // We know that the media stream is secretly a Fake_SourceMediaStream,
   // so now we can start it pulling from us
   nsRefPtr<Fake_SourceMediaStream> fs =
-    static_cast<Fake_SourceMediaStream *>(stream->GetStream());
+    static_cast<Fake_SourceMediaStream *>(ms->GetStream());
 
   test_utils->sts_target()->Dispatch(
     WrapRunnable(fs, &Fake_SourceMediaStream::Start),
     NS_DISPATCH_NORMAL);
 
   return NS_OK;
 }
 
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -97,16 +97,17 @@
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsIDOMHTMLTableElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMHTMLTitleElement.h"
 #include "nsIDOMHTMLUListElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMediaError.h"
 #include "nsIDOMMediaList.h"
+#include "nsIDOMMediaStream.h"
 #include "nsIDOMMessageEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeIterator.h"
 #include "nsIDOMNotifyPaintEvent.h"
@@ -230,18 +231,20 @@
 #include "mozilla/dom/HTMLStyleElementBinding.h"
 #include "mozilla/dom/HTMLTableCaptionElementBinding.h"
 #include "mozilla/dom/HTMLTableCellElementBinding.h"
 #include "mozilla/dom/HTMLTableElementBinding.h"
 #include "mozilla/dom/HTMLTextAreaElementBinding.h"
 #include "mozilla/dom/HTMLTitleElementBinding.h"
 #include "mozilla/dom/HTMLUListElementBinding.h"
 #include "mozilla/dom/KeyEventBinding.h"
+#include "mozilla/dom/LocalMediaStreamBinding.h"
 #include "mozilla/dom/MediaErrorBinding.h"
 #include "mozilla/dom/MediaListBinding.h"
+#include "mozilla/dom/MediaStreamBinding.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/MouseScrollEventBinding.h"
 #include "mozilla/dom/MutationEventBinding.h"
 #include "mozilla/dom/NamedNodeMapBinding.h"
 #include "mozilla/dom/NodeIteratorBinding.h"
 #include "mozilla/dom/NodeBinding.h"
 #include "mozilla/dom/NotifyPaintEventBinding.h"
@@ -417,18 +420,20 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(HTMLStyleElement),
   DEFINE_SHIM(HTMLTableCaptionElement),
   DEFINE_SHIM(HTMLTableCellElement),
   DEFINE_SHIM(HTMLTableElement),
   DEFINE_SHIM(HTMLTextAreaElement),
   DEFINE_SHIM(HTMLTitleElement),
   DEFINE_SHIM(HTMLUListElement),
   DEFINE_SHIM(KeyEvent),
+  DEFINE_SHIM(LocalMediaStream),
   DEFINE_SHIM(MediaError),
   DEFINE_SHIM(MediaList),
+  DEFINE_SHIM(MediaStream),
   DEFINE_SHIM(MessageEvent),
   DEFINE_SHIM(MouseEvent),
   DEFINE_SHIM(MouseScrollEvent),
   DEFINE_SHIM(MutationEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMMozNamedAttrMap, NamedNodeMap),
   DEFINE_SHIM(NodeIterator),
   DEFINE_SHIM(Node),
   DEFINE_SHIM(NotifyPaintEvent),