Bug 896353 - Set principal for mDOMStream in MediaStreamAudioDestinationNode. r=roc
☠☠ backed out by b64e00a36321 ☠ ☠
authorJW Wang <jwwang@mozilla.com>
Tue, 23 Jul 2013 11:54:32 +0800
changeset 140080 7111c04c11584778d34b4a1762b9978c9d0bf79f
parent 140079 4cdfb15c711e73a7fa23ec261b2224f2058a6f62
child 140081 73188e11f7b1fd566b97667d3abfe7742ca509f8
push id31589
push userryanvm@gmail.com
push dateFri, 26 Jul 2013 01:59:11 +0000
treeherdermozilla-inbound@13e83433293b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs896353
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 896353 - Set principal for mDOMStream in MediaStreamAudioDestinationNode. r=roc
content/media/webaudio/MediaStreamAudioDestinationNode.cpp
--- a/content/media/webaudio/MediaStreamAudioDestinationNode.cpp
+++ b/content/media/webaudio/MediaStreamAudioDestinationNode.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 "MediaStreamAudioDestinationNode.h"
+#include "nsIDocument.h"
 #include "mozilla/dom/AudioStreamTrack.h"
 #include "mozilla/dom/MediaStreamAudioDestinationNodeBinding.h"
 #include "AudioNodeEngine.h"
 #include "AudioNodeStream.h"
 #include "DOMMediaStream.h"
 #include "TrackUnionStream.h"
 
 namespace mozilla {
@@ -68,16 +69,21 @@ MediaStreamAudioDestinationNode::MediaSt
 {
   TrackUnionStream* tus = static_cast<TrackUnionStream*>(mDOMStream->GetStream());
   MOZ_ASSERT(tus == mDOMStream->GetStream()->AsProcessedStream());
   tus->SetTrackIDFilter(FilterAudioNodeStreamTrack);
 
   MediaStreamDestinationEngine* engine = new MediaStreamDestinationEngine(this, tus);
   mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
   mPort = tus->AllocateInputPort(mStream, 0);
+
+  nsIDocument* doc = aContext->GetParentObject()->GetExtantDoc();
+  if (doc) {
+    mDOMStream->CombineWithPrincipal(doc->NodePrincipal());
+  }
 }
 
 void
 MediaStreamAudioDestinationNode::DestroyMediaStream()
 {
   AudioNode::DestroyMediaStream();
   if (mPort) {
     mPort->Destroy();