mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 02:05:45 -04:00
FrontendCommon: Add HTTPDownloaderUWP
This commit is contained in:
37
src/frontend-common/http_downloader_uwp.h
Normal file
37
src/frontend-common/http_downloader_uwp.h
Normal file
@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#include "http_downloader.h"
|
||||
|
||||
#include "common/windows_headers.h"
|
||||
|
||||
#include <winrt/windows.Web.Http.h>
|
||||
|
||||
namespace FrontendCommon {
|
||||
|
||||
class HTTPDownloaderUWP final : public HTTPDownloader
|
||||
{
|
||||
public:
|
||||
HTTPDownloaderUWP(std::string user_agent);
|
||||
~HTTPDownloaderUWP() override;
|
||||
|
||||
protected:
|
||||
Request* InternalCreateRequest() override;
|
||||
void InternalPollRequests() override;
|
||||
bool StartRequest(HTTPDownloader::Request* request) override;
|
||||
void CloseRequest(HTTPDownloader::Request* request) override;
|
||||
|
||||
private:
|
||||
struct Request : HTTPDownloader::Request
|
||||
{
|
||||
std::wstring object_name;
|
||||
winrt::Windows::Web::Http::HttpClient client;
|
||||
winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Windows::Web::Http::HttpResponseMessage,
|
||||
winrt::Windows::Web::Http::HttpProgress>
|
||||
request_async{nullptr};
|
||||
winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Windows::Storage::Streams::IBuffer, uint64_t>
|
||||
receive_async{};
|
||||
};
|
||||
|
||||
std::string m_user_agent;
|
||||
};
|
||||
|
||||
} // namespace FrontendCommon
|
Reference in New Issue
Block a user