Fix CefBrowser::GetMainFrame assumptions in the renderer process (see issue #2421)

ClientAppRenderer::Delegate callbacks are executed for all tests. In this case
CorsTest.IframeAllowScriptsCustomNonStandardSchemeToServer was crashing on Linux
because CefBrowser::GetMainFrame() returns nullptr in the renderer process when
called from a cross-origin sub-frame.
This commit is contained in:
Marshall Greenblatt
2021-06-07 13:31:39 -07:00
parent 9353f9b28b
commit ba46b8c53e
3 changed files with 9 additions and 5 deletions

View File

@ -151,7 +151,9 @@ class CefBrowser : public virtual CefBaseRefCounted {
///
// Returns the main (top-level) frame for the browser. In the browser process
// this will return a valid object until after
// CefLifeSpanHandler::OnBeforeClose is called. The main frame object will
// CefLifeSpanHandler::OnBeforeClose is called. In the renderer process this
// will return NULL if the main frame is hosted in a different renderer
// process (e.g. for cross-origin sub-frames). The main frame object will
// change during cross-origin navigation or re-navigation after renderer
// process termination (due to crashes, etc).
///