cef/libcef/common/main_runner_delegate.h
Marshall Greenblatt 262a93b2f7 Split UI thread shutdown into before and after stages (see #3609)
Existing UI thread shutdown tasks need to be executed before the UI
thread RunLoop is terminated. Those tasks have now been moved to
CefMainRunner::StartShutdownOnUIThread and FinishShutdownOnUIThread is
now called after the RunLoop is terminated.

This fixes a shutdown crash in ChromeProcessSingleton::DeleteInstance.
DeleteInstance needs to be called on the UI thread near the end of the
shutdown process (after ChromeProcessSingleton::Cleanup is called via
PostMainMessageLoopRun).
2023-12-13 12:58:55 -05:00

40 lines
1.2 KiB
C++

// Copyright 2020 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_COMMON_MAIN_RUNNER_DELEGATE_H_
#define CEF_LIBCEF_COMMON_MAIN_RUNNER_DELEGATE_H_
#pragma once
#include "include/cef_app.h"
namespace base {
class RunLoop;
}
namespace content {
class ContentMainDelegate;
}
class CefMainRunnerDelegate {
public:
virtual content::ContentMainDelegate* GetContentMainDelegate() = 0;
virtual void BeforeMainThreadInitialize(const CefMainArgs& args) {}
virtual void BeforeMainThreadRun(bool multi_threaded_message_loop) {}
virtual void BeforeMainMessageLoopRun(base::RunLoop* run_loop) {}
virtual bool HandleMainMessageLoopQuit() { return false; }
virtual void BeforeUIThreadInitialize() {}
virtual void AfterUIThreadInitialize() {}
virtual void BeforeUIThreadShutdown() {}
virtual void AfterUIThreadShutdown() {}
virtual void BeforeMainThreadShutdown() {}
virtual void AfterMainThreadShutdown() {}
virtual void BeforeExecuteProcess(const CefMainArgs& args) {}
virtual void AfterExecuteProcess() {}
virtual ~CefMainRunnerDelegate() {}
};
#endif // CEF_LIBCEF_COMMON_MAIN_RUNNER_DELEGATE_H_