// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #if WITH_CEF3 #include "CEFLibCefIncludes.h" /** * Implements a resource handler that will return the contents of a string as the result. */ class FCEFBrowserByteResource : public CefResourceHandler { public: /** */ FCEFBrowserByteResource(const CefRefPtr& PostData, const FString& InMimeType); ~FCEFBrowserByteResource(); // CefResourceHandler interface virtual void Cancel() override; virtual void GetResponseHeaders(CefRefPtr Response, #if CEF_VERSION_MAJOR < 128 int64& ResponseLength, #else int64_t& ResponseLength, #endif CefString& RedirectUrl) override; virtual bool ProcessRequest(CefRefPtr Request, CefRefPtr Callback) override; virtual bool ReadResponse(void* DataOut, int BytesToRead, int& BytesRead, CefRefPtr Callback) override; private: int32 Position; int32 Size; unsigned char* Buffer; FString MimeType; // Include the default reference counting implementation. IMPLEMENT_REFCOUNTING(FCEFBrowserByteResource); }; #endif