Bug 1612724 - Part 2: Use NotifyWhenScriptSafe for MediaManager notifications, r=jib

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2020-02-06 21:57:52 +00:00
Родитель 185c260183
Коммит 148a71bcbc
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -527,7 +527,7 @@ class GetUserMediaWindowListener {
auto req = MakeRefPtr<GetUserMediaRequest>(
globalWindow, VoidString(), VoidString(),
UserActivation::IsHandlingUserInput());
obs->NotifyObservers(req, "recording-device-stopped", nullptr);
obs->NotifyWhenScriptSafe(req, "recording-device-stopped", nullptr);
}
return;
}
@ -589,7 +589,7 @@ class GetUserMediaWindowListener {
auto req = MakeRefPtr<GetUserMediaRequest>(
window, removedRawId, removedSourceType,
UserActivation::IsHandlingUserInput());
obs->NotifyObservers(req, "recording-device-stopped", nullptr);
obs->NotifyWhenScriptSafe(req, "recording-device-stopped", nullptr);
}
}
@ -616,7 +616,7 @@ class GetUserMediaWindowListener {
auto req = MakeRefPtr<GetUserMediaRequest>(
window, removedRawId, removedSourceType,
UserActivation::IsHandlingUserInput());
obs->NotifyObservers(req, "recording-device-stopped", nullptr);
obs->NotifyWhenScriptSafe(req, "recording-device-stopped", nullptr);
}
}
if (mInactiveListeners.Length() == 0 && mActiveListeners.Length() == 0) {
@ -3407,7 +3407,7 @@ void MediaManager::RemoveWindowID(uint64_t aWindowId) {
nsString data = NS_ConvertUTF8toUTF16(windowBuffer);
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
obs->NotifyObservers(nullptr, "recording-window-ended", data.get());
obs->NotifyWhenScriptSafe(nullptr, "recording-window-ended", data.get());
LOG("Sent recording-window-ended for window %" PRIu64 " (outer %" PRIu64 ")",
aWindowId, outerID);
}