mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 12:34:47 +00:00
ncm install task: implement IncrementProgress and update UpdateThroughputMeasurement
This commit is contained in:
parent
0bf39a3bdf
commit
23faebb31c
2 changed files with 7 additions and 1 deletions
|
@ -66,6 +66,7 @@ PrepareContentMeta (both), WritePlaceHolderBuffer, Get/Delete InstallContentMeta
|
|||
void ResetThroughputMeasurement();
|
||||
void SetProgressState(InstallProgressState state);
|
||||
|
||||
void IncrementProgress(s64 size);
|
||||
void UpdateThroughputMeasurement(s64 throughput);
|
||||
bool IsNecessaryInstallTicket(const fs::RightsId &rights_id);
|
||||
void SetTotalSize(s64 size);
|
||||
|
|
|
@ -414,12 +414,17 @@ namespace ams::ncm {
|
|||
|
||||
/* ... */
|
||||
|
||||
void InstallTaskBase::IncrementProgress(s64 size) {
|
||||
std::scoped_lock lk(this->progress_mutex);
|
||||
this->progress.installed_size += size;
|
||||
}
|
||||
|
||||
void InstallTaskBase::UpdateThroughputMeasurement(s64 throughput) {
|
||||
std::scoped_lock lk(this->throughput_mutex);
|
||||
|
||||
if (this->throughput_start_time.GetNanoSeconds() != 0) {
|
||||
this->throughput.installed += throughput;
|
||||
/* TODO. */
|
||||
this->throughput.elapsed_time = os::ConvertToTimeSpan(os::GetSystemTick()) - this->throughput_start_time;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue