mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -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) {
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=5dd3fc70331d85a1c7ce5e402bc1e2f050fbe467$
|
||||
// $hash=d70cd8684eceea74a617559d5573b1875392cfaf$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
|
||||
@@ -41,6 +41,8 @@ class CefBrowserProcessHandlerCToCpp
|
||||
void OnContextInitialized() override;
|
||||
void OnBeforeChildProcessLaunch(
|
||||
CefRefPtr<CefCommandLine> command_line) override;
|
||||
bool OnAlreadyRunningAppRelaunch(CefRefPtr<CefCommandLine> command_line,
|
||||
const CefString& current_directory) override;
|
||||
void OnScheduleMessagePumpWork(int64_t delay_ms) override;
|
||||
CefRefPtr<CefClient> GetDefaultClient() override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user