mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-17 06:12:15 +02:00
ncm install task: implement IncrementProgress and update UpdateThroughputMeasurement
This commit is contained in:
parent
0bf39a3bdf
commit
23faebb31c
@ -66,6 +66,7 @@ PrepareContentMeta (both), WritePlaceHolderBuffer, Get/Delete InstallContentMeta
|
|||||||
void ResetThroughputMeasurement();
|
void ResetThroughputMeasurement();
|
||||||
void SetProgressState(InstallProgressState state);
|
void SetProgressState(InstallProgressState state);
|
||||||
|
|
||||||
|
void IncrementProgress(s64 size);
|
||||||
void UpdateThroughputMeasurement(s64 throughput);
|
void UpdateThroughputMeasurement(s64 throughput);
|
||||||
bool IsNecessaryInstallTicket(const fs::RightsId &rights_id);
|
bool IsNecessaryInstallTicket(const fs::RightsId &rights_id);
|
||||||
void SetTotalSize(s64 size);
|
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) {
|
void InstallTaskBase::UpdateThroughputMeasurement(s64 throughput) {
|
||||||
std::scoped_lock lk(this->throughput_mutex);
|
std::scoped_lock lk(this->throughput_mutex);
|
||||||
|
|
||||||
if (this->throughput_start_time.GetNanoSeconds() != 0) {
|
if (this->throughput_start_time.GetNanoSeconds() != 0) {
|
||||||
this->throughput.installed += throughput;
|
this->throughput.installed += throughput;
|
||||||
/* TODO. */
|
this->throughput.elapsed_time = os::ConvertToTimeSpan(os::GetSystemTick()) - this->throughput_start_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user