Support reconnect of the mojo frame channel (fixes issue #3260)

The mojo channel used for frame communication may disconnect for a variety of
reasons including frame navigation, frame destruction, or insertion into the
BackForwardCache (when the browser-side frame representation is destroyed and
closes the connection). When disconnect occurs we now evaluate the situation
and reconnect if appropriate.

Connections are now initiated solely from the renderer process and the
RenderFrame is passed as an argument to FrameAttached() instead of being
retrieved independently. Messages are queued while the frame is disconnected
and sent only after FrameAttachedAck() is received from the browser process.
The renderer process will be crashed intentionally with a "connection retry
failure" message if the reconnect fails 3 times in a row.
This commit is contained in:
Marshall Greenblatt
2022-02-10 16:52:36 -05:00
parent 80caf947f3
commit 3d1bbaf54f
12 changed files with 340 additions and 131 deletions

View File

@@ -36,7 +36,8 @@ class CefBrowserFrame
private:
// cef::mojom::BrowserFrame methods:
void SendMessage(const std::string& name, base::Value arguments) override;
void FrameAttached() override;
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) override;
void DidFinishFrameLoad(const GURL& validated_url,
int32_t http_status_code) override;
void UpdateDraggableRegions(