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:
@@ -307,8 +307,15 @@ bool CefInitialize(const CefMainArgs& args,
|
||||
g_context = new CefContext();
|
||||
|
||||
// Initialize the global context.
|
||||
return g_context->Initialize(args, settings, application,
|
||||
windows_sandbox_info);
|
||||
if (!g_context->Initialize(args, settings, application,
|
||||
windows_sandbox_info)) {
|
||||
// Initialization failed. Delete the global context object.
|
||||
delete g_context;
|
||||
g_context = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CefShutdown() {
|
||||
@@ -469,10 +476,16 @@ bool CefContext::Initialize(const CefMainArgs& args,
|
||||
|
||||
main_runner_.reset(new CefMainRunner(settings_.multi_threaded_message_loop,
|
||||
settings_.external_message_pump));
|
||||
return main_runner_->Initialize(
|
||||
&settings_, application, args, windows_sandbox_info, &initialized_,
|
||||
base::BindOnce(&CefContext::OnContextInitialized,
|
||||
base::Unretained(this)));
|
||||
if (!main_runner_->Initialize(
|
||||
&settings_, application, args, windows_sandbox_info, &initialized_,
|
||||
base::BindOnce(&CefContext::OnContextInitialized,
|
||||
base::Unretained(this)))) {
|
||||
shutting_down_ = true;
|
||||
FinalizeShutdown();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CefContext::RunMessageLoop() {
|
||||
|
Reference in New Issue
Block a user