Bug 1709484 Move eUseCounter_custom_MozGetUserMediaInsec from mozGetUserMediaDevices to mozGetUserMedia r=jib

Differential Revision: https://phabricator.services.mozilla.com/D114291
This commit is contained in:
Karl Tomlinson 2021-05-05 23:04:12 +00:00
Родитель 154e0379e9
Коммит 57e201057c
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -1283,6 +1283,11 @@ void Navigator::MozGetUserMedia(const MediaStreamConstraints& aConstraints,
aRv.ThrowInvalidStateError("The document is not fully active.");
return;
}
if (Document* doc = mWindow->GetExtantDoc()) {
if (!mWindow->IsSecureContext()) {
doc->SetUseCounter(eUseCounter_custom_MozGetUserMediaInsec);
}
}
RefPtr<MediaManager::StreamPromise> sp;
if (!MediaManager::IsOn(aConstraints.mVideo) &&
!MediaManager::IsOn(aConstraints.mAudio)) {
@ -1329,11 +1334,6 @@ void Navigator::MozGetUserMediaDevices(
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
return;
}
if (Document* doc = mWindow->GetExtantDoc()) {
if (!mWindow->IsSecureContext()) {
doc->SetUseCounter(eUseCounter_custom_MozGetUserMediaInsec);
}
}
RefPtr<MediaManager> manager = MediaManager::Get();
// XXXbz aOnError seems to be unused?
nsCOMPtr<nsPIDOMWindowInner> window(mWindow);