50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
// 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<CefPostDataElement>& PostData, const FString& InMimeType);
|
|
~FCEFBrowserByteResource();
|
|
|
|
// CefResourceHandler interface
|
|
virtual void Cancel() override;
|
|
virtual void GetResponseHeaders(CefRefPtr<CefResponse> Response,
|
|
#if CEF_VERSION_MAJOR < 128
|
|
int64& ResponseLength,
|
|
#else
|
|
int64_t& ResponseLength,
|
|
#endif
|
|
CefString& RedirectUrl) override;
|
|
virtual bool ProcessRequest(CefRefPtr<CefRequest> Request, CefRefPtr<CefCallback> Callback) override;
|
|
virtual bool ReadResponse(void* DataOut, int BytesToRead, int& BytesRead, CefRefPtr<CefCallback> Callback) override;
|
|
|
|
private:
|
|
int32 Position;
|
|
int32 Size;
|
|
unsigned char* Buffer;
|
|
FString MimeType;
|
|
|
|
// Include the default reference counting implementation.
|
|
IMPLEMENT_REFCOUNTING(FCEFBrowserByteResource);
|
|
};
|
|
|
|
|
|
#endif
|