6#include "Containers/Set.h"
27class FOnDemandHttpThread;
28class FOnDemandIoStore;
68 FChunkHttpRequestHandle*
Next =
nullptr;
69 FRequest* OwnerRequest =
nullptr;
163 bool IsCancelled()
const {
return bCancelled; }
166 bool bPrev = bCancelled;
168 return bPrev ==
false;
170 bool IsOk()
const {
return !IsCancelled() && !
Result.HasError(); }
173 bool IsInstall()
const {
return Variant.IsType<FInstall>(); }
174 bool IsPurge()
const {
return Variant.IsType<FPurge>(); }
175 bool IsDefrag()
const {
return Variant.IsType<FDefrag>(); }
176 bool IsVerify()
const {
return Variant.IsType<FVerify>(); }
177 bool IsFlushLastAccess()
const {
return Variant.IsType<FFlushLastAccess>(); }
179 FInstall& AsInstall() {
return Variant.Get<FInstall>(); }
180 FPurge& AsPurge() {
return Variant.Get<FPurge>(); }
181 FDefrag& AsDefrag() {
return Variant.Get<FDefrag>(); }
182 FVerify& AsVerify() {
return Variant.Get<FVerify>(); }
183 FFlushLastAccess& AsFlushLastAccess() {
return Variant.Get<FFlushLastAccess>(); }
189 uint32 SeqNo = NextSeqNo++;
193 bool bCancelled =
false;
197 struct FChunkDownloadRequest
204 bool bChunkCanceled =
false;
207 static bool RequestSortPredicate(
const FRequest&
LHS,
const FRequest& RHS)
209 if (
LHS.Variant.GetIndex() == RHS.Variant.GetIndex())
211 if (
LHS.Priority == RHS.Priority)
213 return LHS.SeqNo < RHS.SeqNo;
216 return LHS.Priority > RHS.Priority;
219 return LHS.SeqNo < RHS.SeqNo;
229 FOnDemandInstallArgs&& Args,
241 bool CanExecuteRequest(FRequest& Request)
const;
242 void TryExecuteNextRequest();
243 void ExecuteRequest(FRequest& Request);
245 void ProcessInstallRequest(FRequest& Request);
246 void ExecuteInstallRequest(FRequest& Request);
247 void ExecutePurgeRequest(FRequest& Request);
248 void ExecuteDefragRequest(FRequest& Request);
249 void ExecuteVerifyRequest(FRequest& Request);
250 void ExectuteFlushLastAccessRequest(FRequest& Request);
251 void ProcessDownloadedChunk(
258 void TryCancelHttpRequestsForInstallRequest(FRequest::FInstall& InstallRequest,
int32&
OutNumCancelled);
259 void NotifyInstallProgress(FRequest& Request);
260 void DestroyRequest(FRequest& Request);
261 void CompleteInstallRequest(FRequest& Request);
262 void CompletePurgeRequest(FRequest& Request);
263 void CompleteDefragRequest(FRequest& Request);
264 void CompleteVerifyRequest(FRequest& Request);
265 void CompleteFlushLastAccessRequest(FRequest& Request);
268 FOnDemandIoStore& IoStore;
269 FOnDemandHttpThread* HttpClient;
273 FRequestAllocator RequestAllocator;
280 std::atomic_bool bShuttingDown{
false};
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EIoErrorCode
Definition IoStatus.h:19
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
UE_REWRITE TValueOrError_ValueProxy< ArgTypes... > MakeValue(ArgTypes &&... Args UE_LIFETIMEBOUND)
Definition ValueOrError.h:35
Definition AssetRegistryState.h:50
Definition IoContainers.h:68
Definition IoAllocators.h:10
Definition OnDemandContentInstaller.h:63
void EnqueueVerifyRequest(FOnDemandVerifyCacheCompleted &&OnCompleted)
Definition OnDemandContentInstaller.cpp:340
FOnDemandContentInstaller(FOnDemandIoStore &IoStore, FOnDemandHttpThread *HttpClient)
Definition OnDemandContentInstaller.cpp:284
void EnqueuePurgeRequest(FOnDemandPurgeArgs &&Args, FOnDemandPurgeCompleted &&OnCompleted)
Definition OnDemandContentInstaller.cpp:320
void UpdateInstallRequestPriority(FSharedInternalInstallRequest InstallRequest, int32 NewPriority)
Definition OnDemandContentInstaller.cpp:417
void EnqueueFlushLastAccessRequest(FOnDemandFlushLastAccessCompleted &&OnCompleted)
Definition OnDemandContentInstaller.cpp:350
~FOnDemandContentInstaller()
Definition OnDemandContentInstaller.cpp:291
void EnqueueDefragRequest(FOnDemandDefragArgs &&Args, FOnDemandDefragCompleted &&OnCompleted)
Definition OnDemandContentInstaller.cpp:330
FSharedInternalInstallRequest EnqueueInstallRequest(FOnDemandInstallArgs &&Args, FOnDemandInstallCompleted &&OnCompleted, FOnDemandInstallProgressed &&OnProgress)
Definition OnDemandContentInstaller.cpp:296
void ReportAnalytics(TArray< FAnalyticsEventAttribute > &OutAnalyticsArray) const
Definition OnDemandContentInstaller.cpp:495
void CancelInstallRequest(FSharedInternalInstallRequest InstallRequest)
Definition OnDemandContentInstaller.cpp:360
bool IsOk(int32 StatusCode)
Definition IHttpResponse.h:38
Definition OverriddenPropertySet.cpp:45
void ResolveChunksToInstall(const TSet< FSharedOnDemandContainer > &Containers, const TSet< FPackageId > &PackageIds, bool bIncludeSoftReferences, bool bIncludeOptionalBulkData, TArray< FResolvedContainerChunks > &OutResolvedContainerChunks, TSet< FPackageId > &OutMissing)
Definition OnDemandContentInstaller.cpp:160
void ResolvePackageDependencies(const TSet< FPackageId > &PackageIds, bool bIncludeSoftReferences, TSet< FPackageId > &OutResolved, TSet< FPackageId > &OutMissing)
Definition OnDemandContentInstaller.cpp:85
NO_LOGGING.
Definition Client.h:20
TUniqueFunction< void(FOnDemandVerifyCacheResult)> FOnDemandVerifyCacheCompleted
Definition IoStoreOnDemand.h:528
TUniqueFunction< void(FOnDemandPurgeResult)> FOnDemandPurgeCompleted
Definition IoStoreOnDemand.h:389
FString LexToString(const FOnDemandContentHandle &Handle)
Definition IoStoreOnDemandInternals.cpp:68
TValueOrError< void, UE::UnifiedError::FError > FResult
Definition OnDemandError.h:32
TFunction< void(FOnDemandInstallProgress)> FOnDemandInstallProgressed
Definition IoStoreOnDemand.h:308
TUniqueFunction< void(FOnDemandFlushLastAccessResult)> FOnDemandFlushLastAccessCompleted
Definition OnDemandIoStore.h:326
TUniqueFunction< void(FOnDemandInstallResult)> FOnDemandInstallCompleted
Definition IoStoreOnDemand.h:324
TUniqueFunction< void(FOnDemandDefragResult)> FOnDemandDefragCompleted
Definition IoStoreOnDemand.h:422
TSharedPtr< class FOnDemandInternalInstallRequest, ESPMode::ThreadSafe > FSharedInternalInstallRequest
Definition IoStoreOnDemand.h:39
UE_STRING_CLASS Result(Forward< LhsType >(Lhs), RhsLen)
Definition String.cpp.inl:732
Definition AnalyticsEventAttribute.h:48
static uint64 Cycles64()
Definition AndroidPlatformTime.h:34
Definition IoContainers.h:52
Definition Optional.h:131
Definition OnDemandContentInstaller.h:111
FOnDemandDefragCompleted OnCompleted
Definition OnDemandContentInstaller.h:117
FOnDemandDefragArgs Args
Definition OnDemandContentInstaller.h:116
FDefrag(FOnDemandDefragArgs &&InArgs, FOnDemandDefragCompleted &&InOnCompleted)
Definition OnDemandContentInstaller.h:112
Definition OnDemandContentInstaller.h:129
FOnDemandFlushLastAccessCompleted OnCompleted
Definition OnDemandContentInstaller.h:133
FFlushLastAccess(FOnDemandFlushLastAccessCompleted &&InOnCompleted)
Definition OnDemandContentInstaller.h:130
Definition OnDemandContentInstaller.h:78
TArray< FChunkHttpRequestHandle > HttpRequestHandles
Definition OnDemandContentInstaller.h:92
FOnDemandInstallArgs Args
Definition OnDemandContentInstaller.h:87
bool bHttpRequestsIssued
Definition OnDemandContentInstaller.h:96
FInstall(FOnDemandInstallArgs &&InArgs, FOnDemandInstallCompleted &&InOnCompleted, FOnDemandInstallProgressed &&InOnProgress)
Definition OnDemandContentInstaller.h:79
FOnDemandInstallCompleted OnCompleted
Definition OnDemandContentInstaller.h:88
uint64 DownloadedChunkCount
Definition OnDemandContentInstaller.h:94
std::atomic_bool bNotifyingProgressOnGameThread
Definition OnDemandContentInstaller.h:97
FOnDemandInstallProgressed OnProgress
Definition OnDemandContentInstaller.h:89
FSharedInternalInstallRequest Request
Definition OnDemandContentInstaller.h:90
uint64 LastProgressCycles
Definition OnDemandContentInstaller.h:95
FOnDemandInstallProgress Progress
Definition OnDemandContentInstaller.h:93
TArray< Private::FResolvedContainerChunks > ResolvedChunks
Definition OnDemandContentInstaller.h:91
Definition OnDemandContentInstaller.h:101
FOnDemandPurgeCompleted OnCompleted
Definition OnDemandContentInstaller.h:107
FOnDemandPurgeArgs Args
Definition OnDemandContentInstaller.h:106
FPurge(FOnDemandPurgeArgs &&InArgs, FOnDemandPurgeCompleted &&InOnCompleted)
Definition OnDemandContentInstaller.h:102
Definition OnDemandContentInstaller.h:121
FOnDemandVerifyCacheCompleted OnCompleted
Definition OnDemandContentInstaller.h:125
FVerify(FOnDemandVerifyCacheCompleted &&InOnCompleted)
Definition OnDemandContentInstaller.h:122
Definition IoStoreOnDemand.h:403
Definition IoStoreOnDemand.h:233
Definition IoStoreOnDemand.h:252
Definition IoStoreOnDemand.h:370
Definition OnDemandContentInstaller.h:37
FSharedOnDemandContainer Container
Definition OnDemandContentInstaller.h:38
TArray< int32 > EntryIndices
Definition OnDemandContentInstaller.h:39
uint64 TotalSize
Definition OnDemandContentInstaller.h:40