You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-110192 #jira UE-110195 #jira UE-110196 [FYI] wes.fudala [FYI] JeanFrancois.Dube #horde 47017 #horde 47016 #ROBOMERGE-SOURCE: CL 15657948 in //UE5/Release-5.0-EarlyAccess/... #ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v779-15635321) [CL 15657981 by alfred reynolds in ue5-main branch]
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "EpicWebHelperCallbackRegistry.h"
|
|
#include "EpicWebHelper.h"
|
|
|
|
#if WITH_CEF3
|
|
|
|
FGuid FEpicWebHelperCallbackRegistry::FindOrAdd(CefRefPtr<CefV8Context> Context, CefRefPtr<CefV8Value> Object, CefRefPtr<CefV8Value> Function, CefRefPtr<CefV8Value> OnError, bool bOneShot)
|
|
{
|
|
if (! bOneShot)
|
|
{
|
|
for(auto Iter = CreateIterator(); Iter; ++Iter)
|
|
{
|
|
auto Value = Iter.Value();
|
|
if (! Value.bOneShot
|
|
&& Context->IsSame(Value.Context)
|
|
&& Function->IsSame(Value.Function)
|
|
&& ( ((Object == nullptr) && (Value.Object == nullptr)) || Object->IsSame(Value.Object))
|
|
&& ( ((OnError == nullptr) && (Value.OnError == nullptr)) || OnError->IsSame(Value.OnError)))
|
|
{
|
|
return Iter.Key();
|
|
}
|
|
}
|
|
}
|
|
|
|
// If not found or one-shot, add new entry to the map
|
|
FGuid Guid = FGuid::NewGuid();
|
|
Add(Guid, FEpicWebHelperCallbackRegistryEntry(Context, Object, Function, OnError, bOneShot));
|
|
return Guid;
|
|
}
|
|
|
|
void FEpicWebHelperCallbackRegistry::RemoveByContext(CefRefPtr<CefV8Context> Context)
|
|
{
|
|
for(auto Iter = CreateIterator(); Iter; ++Iter)
|
|
{
|
|
if (Context->IsSame(Iter.Value().Context))
|
|
{
|
|
Iter.RemoveCurrent();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif // WITH_CEF3
|