From 5afde67593fb2b431b08eafff10db469e0d8ce2f Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 18 Jun 2024 13:49:17 -0400 Subject: [PATCH] chrome: Fix CHECK when switching from kPrerendering to kActive In this case |render_frame_| is not bound, |render_frame_host_| is non-nullptr and |render_frame_host| equals |render_frame_host_| in CefFrameHostImpl::MaybeReAttach when called from CefBrowserInfo::FrameHostStateChanged. --- libcef/browser/frame_host_impl.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index b2e6273a7..faa734738 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -559,11 +559,10 @@ void CefFrameHostImpl::MaybeReAttach( // Should not be called for temporary frames. CHECK(!is_temporary()); - if (require_detached) { - // We expect that Detach() was called previously. - CHECK(!render_frame_.is_bound()); - CHECK(!render_frame_host_); - } else if (render_frame_host_) { + // If |require_detached| then we expect that Detach() was called previously. + CHECK(!require_detached || !render_frame_.is_bound()); + + if (render_frame_host_) { // Intentionally not clearing |queued_renderer_actions_|, as we may be // changing RFH during initial browser navigation. VLOG(1) << GetDebugString()