Commit b0f2472d authored by Ehsan Karamad's avatar Ehsan Karamad Committed by Commit Bot

[ MimeHandlerView ] Fix the cause for a flakiness

The test PDFExtensionInternalLinkClickTest.ShiftLeft exposed a race
where the embedder RenderFrameHost is nullptr by the time the IPC
ReadyToCreateMimeHandlerView arrives. This CL checks |rfh| to ensure it
is not nullptr.

TBR=wjmaclean@chromium.org

Bug: 967045
Change-Id: Ib80499c8d9e758c8ef07b7d06f69429062d8c6ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1633991Reviewed-by: default avatarEhsan Karamad <ekaramad@chromium.org>
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664098}
parent fe46bea1
...@@ -140,6 +140,8 @@ void ExtensionsGuestViewMessageFilter::ReadyToCreateMimeHandlerView( ...@@ -140,6 +140,8 @@ void ExtensionsGuestViewMessageFilter::ReadyToCreateMimeHandlerView(
} }
auto* rfh = auto* rfh =
content::RenderFrameHost::FromID(render_process_id_, render_frame_id); content::RenderFrameHost::FromID(render_process_id_, render_frame_id);
if (!rfh)
return;
if (auto* mhve = MimeHandlerViewEmbedder::Get(rfh->GetFrameTreeNodeId())) if (auto* mhve = MimeHandlerViewEmbedder::Get(rfh->GetFrameTreeNodeId()))
mhve->ReadyToCreateMimeHandlerView(success); mhve->ReadyToCreateMimeHandlerView(success);
} }
......
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