fix: crash on exit in aura platforms with webview (#21022)

* fix: backport upstream patch for shutdown of X11 windows

* fix: check for validity of guest webcontents
This commit is contained in:
Robo
2019-11-07 08:31:43 -08:00
committed by John Kleinschmidt
parent 5b33e9d9b7
commit 55955c3d79
4 changed files with 328 additions and 5 deletions

View File

@@ -64,10 +64,14 @@ content::WebContents* WebViewManager::GetGuestByInstanceID(
bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents,
const GuestCallback& callback) {
for (auto& item : web_contents_embedder_map_)
if (item.second.embedder == embedder_web_contents &&
callback.Run(item.second.web_contents))
for (auto& item : web_contents_embedder_map_) {
if (item.second.embedder != embedder_web_contents)
continue;
auto* guest_web_contents = item.second.web_contents;
if (guest_web_contents && callback.Run(guest_web_contents))
return true;
}
return false;
}