Commit a5b381bd authored by Yuzu Saijo's avatar Yuzu Saijo Committed by Commit Bot

[bfcache] Remove rfh check for tests in ServiceWorkerProviderHost::OnBeginNavigationCommit

This CL removes the check to make sure rfh exists when
ServiceWorkerProviderHost::OnBeginNavigationCommit is called. For
tests this function is called with a fake frame, and this was
causing ServiceWorker tests to fail.

Bug: 1020884
Change-Id: I5d750e50ca19409cf94867b5e07a7ce35eaa33d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1898165
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712488}
parent 55f2fbeb
......@@ -771,8 +771,9 @@ void ServiceWorkerProviderHost::OnBeginNavigationCommit(int render_process_id,
provider_type() == blink::mojom::ServiceWorkerProviderType::kForWindow) {
auto* rfh = RenderFrameHostImpl::FromID(render_process_id_, frame_id_);
// At this point, |rfh| should point at the correct one. (crbug.com/1012238)
DCHECK(rfh);
rfh->AddServiceWorkerProviderHost(this);
// |rfh| may be null in tests (but it should not happen in production).
if (rfh)
rfh->AddServiceWorkerProviderHost(this);
}
TransitionToClientPhase(ClientPhase::kResponseCommitted);
......
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