Improve logging of frame connection state (see issue #3260)

Run with "--vmodule=frame_*=1 --enable-logging=stderr --no-sandbox" on the
command-line to see these log messages from both the browser and renderer
processes.
This commit is contained in:
Marshall Greenblatt
2022-08-16 13:10:43 -04:00
parent a7e50dfe7f
commit 2bf3d536ea
5 changed files with 151 additions and 49 deletions

View File

@ -112,11 +112,17 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
// thread.
content::RenderFrameHost* GetRenderFrameHost() const;
enum class DetachReason {
RENDER_FRAME_DELETED,
NEW_MAIN_FRAME,
BROWSER_DESTROYED,
};
// Owned frame objects will be detached explicitly when the associated
// RenderFrame is deleted. Temporary frame objects will be detached
// implicitly via CefBrowserInfo::browser() returning nullptr. Returns true
// if this was the first call to Detach() for the frame.
bool Detach();
bool Detach(DetachReason reason);
// A frame has swapped to active status from prerendering or the back-forward
// cache. We may need to re-attach if the RFH has changed. See
@ -160,6 +166,8 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
void OnRenderFrameDisconnect();
std::string GetDebugString() const;
const bool is_main_frame_;
// The following members may be read/modified from any thread. All access must