Bug 1208371 - Remove some no longer necessary principal methods on DOMMediaStream. r=mt
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 14 Jan 2016 20:43:35 +0800
changeset 348430 62dec1840f48e9cc5fdee9092fb86131e7950912
parent 348429 f90d9c2716778fd00a52350e1277d202fd322944
child 348431 d11c35de46c969acf2f73498a0764b49edc86f7b
push id14828
push userpehrsons@gmail.com
push dateThu, 07 Apr 2016 12:57:27 +0000
reviewersmt
bugs1208371
milestone48.0a1
Bug 1208371 - Remove some no longer necessary principal methods on DOMMediaStream. r=mt MozReview-Commit-ID: LTVhpY6Bzgf
dom/media/DOMMediaStream.cpp
dom/media/DOMMediaStream.h
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -762,33 +762,17 @@ DOMMediaStream::ApplyConstraintsToTrack(
   promise->MaybeReject(new MediaStreamError(
       mWindow,
       NS_LITERAL_STRING("OverconstrainedError"),
       NS_LITERAL_STRING(""),
       NS_LITERAL_STRING("")));
   return promise.forget();
 }
 
-bool
-DOMMediaStream::CombineWithPrincipal(nsIPrincipal* aPrincipal)
-{
-  bool changed =
-    nsContentUtils::CombineResourcePrincipals(&mPrincipal, aPrincipal);
-  if (changed) {
-    NotifyPrincipalChanged();
-  }
-  return changed;
-}
 
-void
-DOMMediaStream::SetPrincipal(nsIPrincipal* aPrincipal)
-{
-  mPrincipal = aPrincipal;
-  NotifyPrincipalChanged();
-}
 
 void
 DOMMediaStream::PrincipalChanged(MediaStreamTrack* aTrack)
 {
   MOZ_ASSERT(aTrack);
   NS_ASSERTION(HasTrack(*aTrack), "Principal changed for an unknown track");
   LOG(LogLevel::Info, ("DOMMediaStream %p Principal changed for track %p",
                        this, aTrack));
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -438,30 +438,17 @@ public:
    * If this is set, then mPrincipal should be an instance of nsNullPrincipal.
    */
   PeerIdentity* GetPeerIdentity() const { return mPeerIdentity; }
   void SetPeerIdentity(PeerIdentity* aPeerIdentity)
   {
     mPeerIdentity = aPeerIdentity;
   }
 
-  /**
-   * Indicate that data will be contributed to this stream from origin aPrincipal.
-   * If aPrincipal is null, this is ignored. Otherwise, from now on the contents
-   * of this stream can only be accessed by principals that subsume aPrincipal.
-   * Returns true if the stream's principal changed.
-   */
-  bool CombineWithPrincipal(nsIPrincipal* aPrincipal);
 
-  /**
-   * This is used in WebRTC to move from a protected state (nsNullPrincipal) to
-   * one where the stream is accessible to script.  Don't call this.
-   * CombineWithPrincipal is almost certainly more appropriate.
-   */
-  void SetPrincipal(nsIPrincipal* aPrincipal);
 
   // From PrincipalChangeObserver<MediaStreamTrack>.
   void PrincipalChanged(MediaStreamTrack* aTrack) override;
 
   /**
    * Add a PrincipalChangeObserver to this stream.
    *
    * Returns true if it was successfully added.