Files
UnrealEngineUWP/Engine/Source/Runtime/WebBrowser/Private/CEF/CEFBrowserByteResource.cpp
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

39 lines
943 B
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "CEF/CEFBrowserByteResource.h"
#if WITH_CEF3
void FCEFBrowserByteResource::Cancel()
{
}
void FCEFBrowserByteResource::GetResponseHeaders(CefRefPtr<CefResponse> Response, int64& ResponseLength, CefString& RedirectUrl)
{
Response->SetMimeType("text/html");
Response->SetStatus(200);
Response->SetStatusText("OK");
ResponseLength = Size;
}
bool FCEFBrowserByteResource::ProcessRequest(CefRefPtr<CefRequest> Request, CefRefPtr<CefCallback> Callback)
{
Callback->Continue();
return true;
}
bool FCEFBrowserByteResource::ReadResponse(void* DataOut, int BytesToRead, int& BytesRead, CefRefPtr<CefCallback> Callback)
{
int32 BytesLeft = Size - Position;
BytesRead = BytesLeft >= BytesToRead ? BytesToRead : BytesLeft;
if (BytesRead > 0)
{
FMemory::Memcpy(DataOut, Buffer + Position, BytesRead);
Position += BytesRead;
return true;
}
return false;
}
#endif