mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefFrameHandler callbacks for tracking CefFrame lifespan (see issue #2421)
See the new cef_frame_handler.h for complete usage documentation. This change includes the following related enhancements: - The newly added CefBrowser::IsValid method will return false (in the browser process) after CefLifeSpanHandler::OnBeforeClose is called. - CefBrowser::GetMainFrame will return a valid object (in the browser process) until after CefLifeSpanHandler::OnBeforeClose is called. - The main frame object will change during cross-origin navigation or re-navigation after renderer process termination. During that time, GetMainFrame will return the new/pending frame (in the browser process) and any messages that arrive for the new/pending frame will be correctly attributed in OnProcessMessageReceived. - Commands to be executed in the renderer process that may fail during early frame initialization (ExecuteJavaScript, LoadRequest, etc.) will now be queued until after the JavaScript context for the frame has been created. - Logging has been added for any commands that are dropped because they arrived after frame detachment.
This commit is contained in:
@ -47,6 +47,7 @@
|
||||
#include "include/cef_drag_handler.h"
|
||||
#include "include/cef_find_handler.h"
|
||||
#include "include/cef_focus_handler.h"
|
||||
#include "include/cef_frame_handler.h"
|
||||
#include "include/cef_jsdialog_handler.h"
|
||||
#include "include/cef_keyboard_handler.h"
|
||||
#include "include/cef_life_span_handler.h"
|
||||
@ -115,6 +116,14 @@ class CefClient : public virtual CefBaseRefCounted {
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFocusHandler> GetFocusHandler() { return nullptr; }
|
||||
|
||||
///
|
||||
// Return the handler for events related to CefFrame lifespan. This method
|
||||
// will be called once during CefBrowser creation and the result will be
|
||||
// cached for performance reasons.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefFrameHandler> GetFrameHandler() { return nullptr; }
|
||||
|
||||
///
|
||||
// Return the handler for JavaScript dialogs. If no handler is provided the
|
||||
// default implementation will be used.
|
||||
|
Reference in New Issue
Block a user