mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix draggable region update with BackForwardCache enabled (see issue #2421)
When BackForwardCache is enabled and the user navigates the main frame back/forward a new RFH may be created for an existing main frame GlobalId value and CefFrameHostImpl (e.g. an object that was previously Detach()ed after main frame navigation called SetMainFrame, but for which RenderFrameDeleted was not subsequently called due to insertion in the BackForwardCache). In this case we can re-attach the new RFH to the existing main frame CefFrameHostImpl in RenderFrameHostStateChanged and resume processing of messages. Swapping back/forward to an existing (already loaded) renderer does not trigger new notifications for draggable regions (e.g. RenderFrameObserver:: DraggableRegionsChanged is not called by default). We therefore explicitly request an update of draggable regions by sending the DidStopLoading message to the renderer. A new |reattached| parameter is added to CefFrameHandler::OnFrameAttached to support identification of BackForwardCache usage by the client. To test with unit tests: Run `ceftests --gtest_filter=DraggableRegionsTest.DraggableRegionsCrossOrigin --enable-features=BackForwardCache` To test manually: 1. Run `cefclient --enable-features=BackForwardCache --use-views --url=http://tests/draggable`, note that draggable regions work. 2. Load https://www.google.com via the address bar, note that draggable regions are removed. 3. Go back to http://tests/draggable, note that draggable regions work. 4. Go forward to https://www.google.com, note that draggable regions are removed.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=4d483792f68dc51dbc52722820a15795c4a1baad$
|
||||
// $hash=55d17a525f5a5a35a3b75f3636ddecb10bf37b99$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/frame_handler_cpptoc.h"
|
||||
@ -49,7 +49,8 @@ frame_handler_on_frame_created(struct _cef_frame_handler_t* self,
|
||||
void CEF_CALLBACK
|
||||
frame_handler_on_frame_attached(struct _cef_frame_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
cef_frame_t* frame) {
|
||||
cef_frame_t* frame,
|
||||
int reattached) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@ -68,7 +69,8 @@ frame_handler_on_frame_attached(struct _cef_frame_handler_t* self,
|
||||
|
||||
// Execute
|
||||
CefFrameHandlerCppToC::Get(self)->OnFrameAttached(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame));
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
||||
reattached ? true : false);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
|
Reference in New Issue
Block a user