UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DownloadService.mock.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
6
7#if WITH_DEV_AUTOMATION_TESTS
8
9namespace BuildPatchServices
10{
12 : public IDownloadService
13 {
14 public:
17
18 public:
20 : Count(0)
21 {
22 }
23
24 virtual int32 RequestFile(const FString& FileUri, const FDownloadCompleteDelegate& OnCompleteDelegate, const FDownloadProgressDelegate& OnProgressDelegate) override
25 {
26 FScopeLock ScopeLock(&ThreadLock);
29 {
30 ReturnId = RequestFileFunc(FileUri, OnCompleteDelegate, OnProgressDelegate);
31 }
32 else
33 {
34 ReturnId = ++Count;
35 }
36 RxRequestFile.Emplace(FStatsCollector::GetSeconds(), ReturnId, FileUri, OnCompleteDelegate, OnProgressDelegate);
37 return ReturnId;
38 }
39
40 virtual int32 RequestFileWithHeaders(const FString& FileUri, const TMap<FString, FString>& Headers, const FDownloadCompleteDelegate& OnCompleteDelegate, const FDownloadProgressDelegate& OnProgressDelegate) override
41 {
42 return RequestFile(FileUri, OnCompleteDelegate, OnProgressDelegate);
43 }
44
45 virtual void RequestCancel(int32 RequestId) override
46 {
47 FScopeLock ScopeLock(&ThreadLock);
49 {
50 RequestCancelFunc(RequestId);
51 }
52 RxRequestCancel.Emplace(FStatsCollector::GetSeconds(), RequestId);
53 }
54
55 virtual void RequestAbandon(int32 RequestId) override
56 {
57 FScopeLock ScopeLock(&ThreadLock);
59 {
60 RequestCancelFunc(RequestId);
61 }
62 RxRequestCancel.Emplace(FStatsCollector::GetSeconds(), RequestId);
63 }
64
65 public:
66 FCriticalSection ThreadLock;
72 };
73}
74
75#endif //WITH_DEV_AUTOMATION_TESTS
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
Definition ScopeLock.h:141
Definition Array.h:670
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition BuildPatchFileConstructor.h:28
Definition Tuple.h:652