// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #if WITH_CEF3 #include "CEFLibCefIncludes.h" // Helper for posting a closure as a task class FCEFBrowserClosureTask : public CefTask { public: FCEFBrowserClosureTask(CefRefPtr InHandle, TFunction InClosure) : Handle(InHandle) , Closure(InClosure) { } virtual void Execute() override { Closure(); } private: CefRefPtr Handle; // Used so the handler will not go out of scope before the closure is executed. TFunction Closure; IMPLEMENT_REFCOUNTING(FCEFBrowserClosureTask); }; #endif /* WITH_CEF3 */