chrome: Add callback for already running app relaunch (fixes #3609)

Adds a new CefBrowserProcessHandler::OnAlreadyRunningAppRelaunch
callback for when an already running app is relaunched with the
same CefSettings.root_cache_path.

Client apps should check the CefInitialize() return value for early
exit of the relaunch source process.
This commit is contained in:
Marshall Greenblatt
2023-11-28 20:33:44 -05:00
parent d6af79e7a6
commit a25f89f9e4
45 changed files with 553 additions and 178 deletions

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=533775387bf1001675aeb94a62bc4ece1eb11125$
// $hash=8a552c517824da5047969cf0ef19a9258596e3b9$
//
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
@ -79,6 +79,33 @@ void CefBrowserProcessHandlerCToCpp::OnBeforeChildProcessLaunch(
_struct, CefCommandLineCppToC::Wrap(command_line));
}
NO_SANITIZE("cfi-icall")
bool CefBrowserProcessHandlerCToCpp::OnAlreadyRunningAppRelaunch(
CefRefPtr<CefCommandLine> command_line,
const CefString& current_directory) {
cef_browser_process_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_already_running_app_relaunch)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: command_line; type: refptr_diff
DCHECK(command_line.get());
if (!command_line.get()) {
return false;
}
// Unverified params: current_directory
// Execute
int _retval = _struct->on_already_running_app_relaunch(
_struct, CefCommandLineCppToC::Wrap(command_line),
current_directory.GetStruct());
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
void CefBrowserProcessHandlerCToCpp::OnScheduleMessagePumpWork(
int64_t delay_ms) {