alloy: Fix FrameHandlerTest failures with BackForwardCache enabled (see issue #2421)

To test:
Run `ceftests --gtest_filter=FrameHandlerTest.OrderSub*
              --enable-features=BackForwardCache`
This commit is contained in:
Marshall Greenblatt
2021-09-15 21:40:53 +03:00
parent 7a56371b84
commit db807e804a
4 changed files with 25 additions and 2 deletions

View File

@@ -52,6 +52,13 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// (to set) and DestroyBrowser (to clear).
void SetBrowser(CefRefPtr<CefBrowserHostBase> browser);
// Called after OnBeforeClose and before SetBrowser(nullptr). This will cause
// browser() and GetMainFrame() to return nullptr as expected by
// CefFrameHandler callbacks. Note that this differs from calling
// SetBrowser(nullptr) because the WebContents has not yet been destroyed and
// further frame-related callbacks are expected.
void SetClosing();
// Ensure that a frame record exists for |host|. Called for the main frame
// when the RenderView is created, or for a sub-frame when the associated
// RenderFrame is created in the renderer process.
@@ -239,6 +246,9 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// The current main frame.
CefRefPtr<CefFrameHostImpl> main_frame_;
// True if the browser is currently closing.
bool is_closing_ = false;
// Only accessed on the UI thread.
std::vector<CefDraggableRegion> draggable_regions_;