2020-06-24 22:34:12 -04:00
|
|
|
// Copyright 2020 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright 2012 The Chromium 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_CHROME_CHROME_MAIN_RUNNER_DELEGATE_CEF_
|
|
|
|
#define CEF_LIBCEF_COMMON_CHROME_CHROME_MAIN_RUNNER_DELEGATE_CEF_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2020-06-28 17:05:36 -04:00
|
|
|
#include "include/cef_app.h"
|
2020-06-24 22:34:12 -04:00
|
|
|
#include "libcef/common/main_runner_delegate.h"
|
|
|
|
#include "libcef/common/main_runner_handler.h"
|
|
|
|
|
|
|
|
class ChromeMainDelegateCef;
|
|
|
|
class MainThreadStackSamplingProfiler;
|
|
|
|
class ScopedKeepAlive;
|
|
|
|
|
|
|
|
class ChromeMainRunnerDelegate : public CefMainRunnerDelegate {
|
|
|
|
public:
|
|
|
|
// |runner| will be non-nullptr for the main process only, and will outlive
|
|
|
|
// this object.
|
2020-06-28 17:05:36 -04:00
|
|
|
ChromeMainRunnerDelegate(CefMainRunnerHandler* runner,
|
2020-07-06 14:14:57 -04:00
|
|
|
CefSettings* settings,
|
2020-06-28 17:05:36 -04:00
|
|
|
CefRefPtr<CefApp> application);
|
2021-12-06 15:40:25 -05:00
|
|
|
|
|
|
|
ChromeMainRunnerDelegate(const ChromeMainRunnerDelegate&) = delete;
|
|
|
|
ChromeMainRunnerDelegate& operator=(const ChromeMainRunnerDelegate&) = delete;
|
|
|
|
|
2020-06-24 22:34:12 -04:00
|
|
|
~ChromeMainRunnerDelegate() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// CefMainRunnerDelegate overrides.
|
|
|
|
content::ContentMainDelegate* GetContentMainDelegate() override;
|
|
|
|
void BeforeMainThreadInitialize(const CefMainArgs& args) override;
|
2023-04-04 14:00:13 -04:00
|
|
|
void BeforeMainThreadRun(bool multi_threaded_message_loop) override;
|
2020-06-24 22:34:12 -04:00
|
|
|
void BeforeMainMessageLoopRun(base::RunLoop* run_loop) override;
|
2020-07-03 22:51:17 -04:00
|
|
|
bool HandleMainMessageLoopQuit() override;
|
2023-03-14 15:12:03 -04:00
|
|
|
void BeforeUIThreadInitialize() override;
|
2022-03-09 14:45:39 -05:00
|
|
|
void AfterUIThreadShutdown() override;
|
2020-06-24 22:34:12 -04:00
|
|
|
void BeforeExecuteProcess(const CefMainArgs& args) override;
|
|
|
|
void AfterExecuteProcess() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<ChromeMainDelegateCef> main_delegate_;
|
|
|
|
|
|
|
|
std::unique_ptr<MainThreadStackSamplingProfiler> sampling_profiler_;
|
|
|
|
std::unique_ptr<ScopedKeepAlive> keep_alive_;
|
|
|
|
|
|
|
|
CefMainRunnerHandler* const runner_;
|
2020-07-06 14:14:57 -04:00
|
|
|
CefSettings* const settings_;
|
2020-06-28 17:05:36 -04:00
|
|
|
CefRefPtr<CefApp> application_;
|
2020-06-24 22:34:12 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_CHROME_CHROME_MAIN_RUNNER_DELEGATE_CEF_
|