Commit 8f4b865f authored by ekaramad's avatar ekaramad Committed by Commit bot

Fix a crash related to null BrowserPluginGuest on Mac

The lifetimes of RenderWidgetHostViewGuest and BrowserPluginGuest are not tied together and
it is possible for BrowserPluginGuest to be destroyed sooner than RenderWidgetHostViewGuest.

This CL will check for |guest_| null-ness before getting owner's RenderWidgetHostView from
it.

BUG=674417
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2588233002
Cr-Commit-Position: refs/heads/master@{#439719}
parent 9f14d907
......@@ -544,8 +544,9 @@ void RenderWidgetHostViewGuest::UnlockCompositingSurface() {
RenderWidgetHostViewBase*
RenderWidgetHostViewGuest::GetOwnerRenderWidgetHostView() const {
return static_cast<RenderWidgetHostViewBase*>(
guest_->GetOwnerRenderWidgetHostView());
return guest_ ? static_cast<RenderWidgetHostViewBase*>(
guest_->GetOwnerRenderWidgetHostView())
: nullptr;
}
// TODO(wjmaclean): When we remove BrowserPlugin, delete this code.
......
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