Files
UnrealEngineUWP/Engine/Source/Runtime/WebBrowser/Private/CEF/CEFBrowserClosureTask.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

46 lines
918 B
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#if WITH_CEF3
#if PLATFORM_WINDOWS
#include "AllowWindowsPlatformTypes.h"
#endif
#pragma push_macro("OVERRIDE")
#undef OVERRIDE // cef headers provide their own OVERRIDE macro
#include "include/cef_task.h"
#pragma pop_macro("OVERRIDE")
#if PLATFORM_WINDOWS
#include "HideWindowsPlatformTypes.h"
#endif
// Helper for posting a closure as a task
class FCEFBrowserClosureTask
: public CefTask
{
public:
FCEFBrowserClosureTask(CefRefPtr<CefBase> InHandle, TFunction<void ()> InClosure)
: Handle(InHandle)
, Closure(InClosure)
{ }
virtual void Execute() override
{
Closure();
}
private:
CefRefPtr<CefBase> Handle; // Used so the handler will not go out of scope before the closure is executed.
TFunction<void ()> Closure;
IMPLEMENT_REFCOUNTING(FCEFBrowserClosureTask);
};
#endif /* WITH_CEF3 */