Bug 1208371 - Remove CORSMode methods from DOMMediaStream. r?mt draft
authorAndreas Pehrson <pehrsons@gmail.com>
Tue, 05 Jan 2016 10:16:27 +0800
changeset 342134 e38700f246f8924cc7c4635aef4d9f18fd21c268
parent 342133 6092f83a0f42b67d75fb998a975b990d92eab9aa
child 342135 30970d7ea3df4930afaab72b2390293472c23727
push id13352
push userpehrsons@gmail.com
push dateFri, 18 Mar 2016 13:49:47 +0000
reviewersmt
bugs1208371
milestone47.0a1
Bug 1208371 - Remove CORSMode methods from DOMMediaStream. r?mt MozReview-Commit-ID: KiJPucdErFV
dom/media/DOMMediaStream.cpp
dom/media/DOMMediaStream.h
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -326,17 +326,17 @@ NS_IMPL_RELEASE_INHERITED(DOMAudioNodeMe
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMAudioNodeMediaStream)
 NS_INTERFACE_MAP_END_INHERITING(DOMMediaStream)
 
 DOMMediaStream::DOMMediaStream(nsPIDOMWindowInner* aWindow,
                                MediaStreamTrackSourceGetter* aTrackSourceGetter)
   : mLogicalStreamStartTime(0), mWindow(aWindow),
     mInputStream(nullptr), mOwnedStream(nullptr), mPlaybackStream(nullptr),
     mTrackSourceGetter(aTrackSourceGetter), mTracksCreated(false),
-    mNotifiedOfMediaStreamGraphShutdown(false), mCORSMode(CORS_NONE)
+    mNotifiedOfMediaStreamGraphShutdown(false)
 {
   nsresult rv;
   nsCOMPtr<nsIUUIDGenerator> uuidgen =
     do_GetService("@mozilla.org/uuid-generator;1", &rv);
 
   if (NS_SUCCEEDED(rv) && uuidgen) {
     nsID uuid;
     memset(&uuid, 0, sizeof(uuid));
@@ -881,30 +881,16 @@ DOMMediaStream::RecomputePrincipal()
                                               info->GetTrack()->GetPrincipal());
   }
   if (previousPrincipal != mPrincipal) {
     NotifyPrincipalChanged();
   }
 }
 
 void
-DOMMediaStream::SetCORSMode(CORSMode aCORSMode)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  mCORSMode = aCORSMode;
-}
-
-CORSMode
-DOMMediaStream::GetCORSMode()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  return mCORSMode;
-}
-
-void
 DOMMediaStream::NotifyPrincipalChanged()
 {
   if (!mPrincipal) {
     // When all tracks are removed, mPrincipal will change to nullptr.
     LOG(LogLevel::Info, ("DOMMediaStream %p Principal changed to nothing.",
                          this));
   } else {
     LOG(LogLevel::Info, ("DOMMediaStream %p Principal changed. Now: "
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -10,17 +10,16 @@
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "StreamBuffer.h"
 #include "nsIDOMWindow.h"
 #include "nsIPrincipal.h"
 #include "mozilla/PeerIdentity.h"
 #include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/CORSMode.h"
 #include "PrincipalChangeObserver.h"
 
 // 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
 #endif
@@ -440,18 +439,16 @@ public:
   virtual DOMHwMediaStream* AsDOMHwMediaStream() { return nullptr; }
 
   bool IsFinished();
   /**
    * Returns a principal indicating who may access this stream. The stream contents
    * can only be accessed by principals subsuming this principal.
    */
   nsIPrincipal* GetPrincipal() { return mPrincipal; }
-  mozilla::CORSMode GetCORSMode();
-  void SetCORSMode(mozilla::CORSMode aCORSMode);
 
   /**
    * These are used in WebRTC.  A peerIdentity constrained MediaStream cannot be sent
    * across the network to anything other than a peer with the provided identity.
    * If this is set, then mPrincipal should be an instance of nsNullPrincipal.
    */
   PeerIdentity* GetPeerIdentity() const { return mPeerIdentity; }
   void SetPeerIdentity(PeerIdentity* aPeerIdentity)