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:
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=bdbe1ed03a5ab0ca22668417c329555a3b0d9cea$
|
||||
// $hash=69e482e4a20c97d54dc21f892f9e70e3d5d80f47$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/client_cpptoc.h"
|
||||
@ -21,6 +21,7 @@
|
||||
#include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/find_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/frame_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
|
||||
@ -164,6 +165,22 @@ client_get_focus_handler(struct _cef_client_t* self) {
|
||||
return CefFocusHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_frame_handler_t* CEF_CALLBACK
|
||||
client_get_frame_handler(struct _cef_client_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefFrameHandler> _retval =
|
||||
CefClientCppToC::Get(self)->GetFrameHandler();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefFrameHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_jsdialog_handler_t* CEF_CALLBACK
|
||||
client_get_jsdialog_handler(struct _cef_client_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@ -322,6 +339,7 @@ CefClientCppToC::CefClientCppToC() {
|
||||
GetStruct()->get_drag_handler = client_get_drag_handler;
|
||||
GetStruct()->get_find_handler = client_get_find_handler;
|
||||
GetStruct()->get_focus_handler = client_get_focus_handler;
|
||||
GetStruct()->get_frame_handler = client_get_frame_handler;
|
||||
GetStruct()->get_jsdialog_handler = client_get_jsdialog_handler;
|
||||
GetStruct()->get_keyboard_handler = client_get_keyboard_handler;
|
||||
GetStruct()->get_life_span_handler = client_get_life_span_handler;
|
||||
|
Reference in New Issue
Block a user