Files
UnrealEngine/Engine/Source/Runtime/WebBrowser/Private/CEF/CEFBrowserApp.h
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

52 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Misc/ScopeLock.h"
#if WITH_CEF3
#include "CEFLibCefIncludes.h"
DECLARE_LOG_CATEGORY_EXTERN(LogCEFBrowser, Log, All);
/**
* Implements CEF App and other Process level interfaces
*/
class FCEFBrowserApp : public CefApp,
public CefBrowserProcessHandler
{
public:
/**
* Default Constructor
*/
FCEFBrowserApp();
/** Used to pump the CEF message loop whenever OnScheduleMessagePumpWork is triggered */
bool TickMessagePump(float DeltaTime, bool bForce);
private:
// CefApp methods.
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override { return this; }
virtual void OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine) override;
// CefBrowserProcessHandler methods:
virtual void OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> CommandLine) override;
#if CEF_VERSION_MAJOR < 128
virtual void OnScheduleMessagePumpWork(int64 delay_ms) override;
#else
virtual void OnScheduleMessagePumpWork(int64_t delay_ms) override;
virtual bool OnAlreadyRunningAppRelaunch(CefRefPtr<CefCommandLine> CommandLine, const CefString& CurrentDirectory) override;
#endif
// Include the default reference counting implementation.
IMPLEMENT_REFCOUNTING(FCEFBrowserApp);
// Lock for access MessagePumpCountdown
FCriticalSection MessagePumpCountdownCS;
// Countdown in milliseconds until CefDoMessageLoopWork is called. Updated by OnScheduleMessagePumpWork
int64 MessagePumpCountdown;
};
#endif