Commit 46de46a7 authored by Andrei Pascovici's avatar Andrei Pascovici Committed by Commit Bot

Fix for internal bug below (crash when starting->pausing->disconnecting Cast)

Bug: internal/112284077
Change-Id: I4b61b81fa9ba5c6d97642b78504f56c1d6454738
Reviewed-on: https://chromium-review.googlesource.com/1182869
Commit-Queue: Andrei Pascovici <apascovici@chromium.org>
Reviewed-by: default avatarSimeon Anfinrud <sanfin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584838}
parent 3abf5704
...@@ -77,7 +77,13 @@ class CastWebContentsView { ...@@ -77,7 +77,13 @@ class CastWebContentsView {
contentView, window, WebContents.createDefaultInternalsHolder()); contentView, window, WebContents.createDefaultInternalsHolder());
// Enable display of current webContents. // Enable display of current webContents.
webContents.onShow(); webContents.onShow();
return webContents::onHide; return () -> {
if (!webContents.isDestroyed()) {
// WebContents can be destroyed by the app before CastWebContentsComponent
// unbinds, which is why we need this check.
webContents.onHide();
}
};
}; };
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment