2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Register streaming loaders in Storage::Downloader.

This commit is contained in:
John Preston
2019-04-12 14:50:41 +04:00
parent cca906d383
commit b2895a39ed
11 changed files with 158 additions and 98 deletions

View File

@@ -12,6 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/binary_guard.h"
#include "data/data_file_origin.h"
class ApiWrap;
namespace Storage {
namespace Cache {
struct Key;
@@ -35,9 +37,13 @@ public:
FileLoader *end = nullptr;
};
Downloader();
explicit Downloader(not_null<ApiWrap*> api);
~Downloader();
ApiWrap &api() const {
return *_api;
}
int currentPriority() const {
return _priority;
}
@@ -58,6 +64,8 @@ private:
void killDownloadSessionsStop(MTP::DcId dcId);
void killDownloadSessions();
not_null<ApiWrap*> _api;
base::Observable<void> _taskFinishedObservable;
int _priority = 1;