Bug 1208371 - Remove some no longer necessary principal methods on DOMMediaStream. r?mt draft
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 14 Jan 2016 20:43:35 +0800
changeset 342112 063b7551222be1238e3d39fef3d795bcb6649fb4
parent 342111 0b0cb201417390dcddc9b63b8407a3e9d89ca7c3
child 342113 a51dd8868a6d6fff642b18f240bdeba13aa353be
push id13352
push userpehrsons@gmail.com
push dateFri, 18 Mar 2016 13:49:47 +0000
reviewersmt
bugs1208371
milestone47.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
@@ -755,33 +755,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.