Bug 771833: Assign an nsIPrincipal to media streams returned by getUserMedia; r=roc

This commit is contained in:
Anant Narayanan 2012-07-12 04:53:48 -07:00
parent 9e902cd6a9
commit 49cb4ef18b
2 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,13 @@ public:
// Create a media stream.
nsCOMPtr<nsDOMMediaStream> stream = nsDOMMediaStream::CreateInputStream();
nsPIDOMWindow *window = static_cast<nsPIDOMWindow*>
(nsGlobalWindow::GetOuterWindowWithId(mWindowID));
if (window && window->GetExtantDoc()) {
stream->CombineWithPrincipal(window->GetExtantDoc()->NodePrincipal());
}
// Add our listener. We'll call Start() on the source when get a callback
// that the MediaStream has started consuming. The listener is freed
// when the page is invalidated (on navigation or close).

View File

@ -6,6 +6,7 @@
#include "mozilla/Services.h"
#include "nsHashKeys.h"
#include "nsGlobalWindow.h"
#include "nsClassHashtable.h"
#include "nsObserverService.h"