зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1440356 - Only call the window callback for found listeners. r=johannh
--HG-- extra : rebase_source : 8f9d46574cfe42fadd5c325d310df0e6f304f106 extra : histedit_source : 213e340980db569309a994f25e2eb0b2b2de61e6
This commit is contained in:
Родитель
7f249574a3
Коммит
e3a7f4a047
|
@ -3116,9 +3116,6 @@ MediaManager::OnNavigation(uint64_t aWindowID)
|
|||
// Grab a strong ref since RemoveAll() might destroy the listener
|
||||
// mid-way when clearing the mActiveWindows reference.
|
||||
RefPtr<GetUserMediaWindowListener> listener(aListener);
|
||||
if (!listener) {
|
||||
return;
|
||||
}
|
||||
|
||||
listener->Stop();
|
||||
listener->RemoveAll();
|
||||
|
@ -3665,10 +3662,6 @@ MediaManager::StopScreensharing(uint64_t aWindowID)
|
|||
IterateWindowListeners(window->AsInner(),
|
||||
[](GetUserMediaWindowListener* aListener)
|
||||
{
|
||||
if (!aListener) {
|
||||
return;
|
||||
}
|
||||
|
||||
aListener->StopSharing();
|
||||
});
|
||||
}
|
||||
|
@ -3684,7 +3677,9 @@ MediaManager::IterateWindowListeners(nsPIDOMWindowInner* aWindow,
|
|||
{
|
||||
uint64_t windowID = aWindow->WindowID();
|
||||
GetUserMediaWindowListener* listener = GetWindowListener(windowID);
|
||||
aCallback(listener);
|
||||
if (listener) {
|
||||
aCallback(listener);
|
||||
}
|
||||
// NB: `listener` might have been destroyed.
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче