Bug 1371741 - Disallow getUserMedia on null principals. r=jib

Differential Revision: https://phabricator.services.mozilla.com/D16220

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Johann Hofmann 2019-01-11 10:49:37 +00:00
parent e2eb313127
commit ca334646e4

View File

@ -2426,6 +2426,13 @@ RefPtr<MediaManager::StreamPromise> MediaManager::GetUserMedia(
__func__);
}
// Disallow access to null principal pages.
if (principal->GetIsNullPrincipal()) {
return StreamPromise::CreateAndReject(
MakeRefPtr<MediaMgrError>(MediaMgrError::Name::NotAllowedError),
__func__);
}
// This principal needs to be sent to different threads and so via IPC.
// For this reason it's better to convert it to PrincipalInfo right now.
ipc::PrincipalInfo principalInfo;