CEFInterfaceBrowserApp.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Engine/Source/Runtime/WebBrowser/Private/CEF/CEFBrowserApp.h
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "Misc/ScopeLock.h"
  5. #if WITH_CEF3
  6. #include "CEFInterfaceLibCefIncludes.h"
  7. DECLARE_LOG_CATEGORY_EXTERN(LogCEFInterfaceBrowser, Log, All);
  8. /**
  9. * Implements CEF App and other Process level interfaces
  10. */
  11. class FCEFInterfaceBrowserApp : public CefApp,
  12. public CefBrowserProcessHandler
  13. {
  14. public:
  15. /**
  16. * Default Constructor
  17. */
  18. FCEFInterfaceBrowserApp(bool bInGPU);
  19. /** Used to pump the CEF message loop whenever OnScheduleMessagePumpWork is triggered */
  20. bool TickMessagePump(float DeltaTime, bool bForce);
  21. private:
  22. // CefApp methods.
  23. virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override { return this; }
  24. virtual void OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine) override;
  25. // CefBrowserProcessHandler methods:
  26. virtual void OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> CommandLine) override;
  27. virtual void OnScheduleMessagePumpWork(int64 delay_ms) override;
  28. // Include the default reference counting implementation.
  29. IMPLEMENT_REFCOUNTING(FCEFInterfaceBrowserApp);
  30. // Lock for access MessagePumpCountdown
  31. FCriticalSection MessagePumpCountdownCS;
  32. // Countdown in milliseconds until CefDoMessageLoopWork is called. Updated by OnScheduleMessagePumpWork
  33. int64 MessagePumpCountdown;
  34. // WebGL toggle
  35. bool bGPU;
  36. };
  37. #endif