Don't reconnect after intentional browser frame detach (see issue #3260)

Send a FrameDetached message from CefFrameHostImpl::Detach before closing
the RenderFrame connection to avoid an immediate reconnect attempt by the
renderer.

When BFCache is disabled the intentionally detached frame will never be
reconnected. When BFCache is enabled the intentionally detached frame will
be reconnected via CefFrameImpl::OnWasShown if/when it exits the cache.
This commit is contained in:
Marshall Greenblatt
2022-08-16 14:47:47 -04:00
parent 2bf3d536ea
commit 6d71f5ffd7
4 changed files with 27 additions and 3 deletions

View File

@@ -127,6 +127,7 @@ class CefFrameImpl
enum class DisconnectReason {
DETACHED,
BROWSER_FRAME_DETACHED,
CONNECT_TIMEOUT,
RENDER_FRAME_DISCONNECT,
BROWSER_FRAME_DISCONNECT,
@@ -147,6 +148,7 @@ class CefFrameImpl
// cef::mojom::RenderFrame methods:
void FrameAttachedAck() override;
void FrameDetached() override;
void SendMessage(const std::string& name, base::Value arguments) override;
void SendSharedMemoryRegion(const std::string& name,
base::ReadOnlySharedMemoryRegion region) override;