fix: handle OnDelegatedSourceListDismissed asynchronously (#46234)
This fixes a crash with the PipeWire capturer caused by a Chromium
change introduced in
5783826
.
DesktopMediaListBase now calls Refresh(true) after dispatching
DesktopMediaListObserver::OnDelegatedSourceListDismissed, so it's
important not to call DesktopCapturer::HandleFailure (which deallocates
the DesktopMediaList) synchronously from OnDelegatedSourceListDismissed.
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Beutner <beutner.john@gmail.com>
This commit is contained in:
parent
a82f92e1d8
commit
09ec28b150
1 changed files with 3 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
||||||
#include "chrome/browser/media/webrtc/desktop_media_list.h"
|
#include "chrome/browser/media/webrtc/desktop_media_list.h"
|
||||||
#include "chrome/browser/media/webrtc/thumbnail_capturer_mac.h"
|
#include "chrome/browser/media/webrtc/thumbnail_capturer_mac.h"
|
||||||
#include "chrome/browser/media/webrtc/window_icon_util.h"
|
#include "chrome/browser/media/webrtc/window_icon_util.h"
|
||||||
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/public/browser/desktop_capture.h"
|
#include "content/public/browser/desktop_capture.h"
|
||||||
#include "gin/handle.h"
|
#include "gin/handle.h"
|
||||||
#include "gin/object_template_builder.h"
|
#include "gin/object_template_builder.h"
|
||||||
|
@ -252,7 +253,8 @@ void DesktopCapturer::DesktopListListener::OnSourceThumbnailChanged(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesktopCapturer::DesktopListListener::OnDelegatedSourceListDismissed() {
|
void DesktopCapturer::DesktopListListener::OnDelegatedSourceListDismissed() {
|
||||||
std::move(failure_callback_).Run();
|
content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
|
||||||
|
std::move(failure_callback_));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesktopCapturer::StartHandling(bool capture_window,
|
void DesktopCapturer::StartHandling(bool capture_window,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue