mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
HTTPDownloader: Add support for progress updates/cancelling
This commit is contained in:
committed by
Connor McLaughlin
parent
f18964ad44
commit
7715d122c7
@@ -20,6 +20,7 @@
|
||||
#include "common/Console.h"
|
||||
#include "common/StringUtil.h"
|
||||
#include "common/Timer.h"
|
||||
|
||||
#include <VersionHelpers.h>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -39,16 +40,16 @@ HTTPDownloaderWinHttp::~HTTPDownloaderWinHttp()
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<HTTPDownloader> HTTPDownloader::Create(const char* user_agent)
|
||||
std::unique_ptr<HTTPDownloader> HTTPDownloader::Create(std::string user_agent)
|
||||
{
|
||||
std::unique_ptr<HTTPDownloaderWinHttp> instance(std::make_unique<HTTPDownloaderWinHttp>());
|
||||
if (!instance->Initialize(user_agent))
|
||||
if (!instance->Initialize(std::move(user_agent)))
|
||||
return {};
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
bool HTTPDownloaderWinHttp::Initialize(const char* user_agent)
|
||||
bool HTTPDownloaderWinHttp::Initialize(std::string user_agent)
|
||||
{
|
||||
const DWORD dwAccessType = WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user