MCPcopy Create free account
hub / github.com/axmolengine/axmol / _onUpdate

Method _onUpdate

core/network/Downloader-curl.cpp:860–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860void DownloaderCURL::_onUpdate(float)
861{
862 std::vector<std::shared_ptr<DownloadTask>> tasks;
863
864 // update processing tasks
865 _impl->getProcessTasks(tasks);
866 for (auto&& task : tasks)
867 {
868 auto context = static_cast<DownloadContextCURL*>(task->_context.get());
869 std::lock_guard<std::recursive_mutex> lock(context->_mutex);
870 if (context->_bytesReceived)
871 {
872 _updateTaskProgressInfo(*task);
873 onTaskProgress(*task);
874 context->_bytesReceived = 0;
875 }
876 }
877 tasks.clear();
878
879 // update finished tasks
880 _impl->getFinishedTasks(tasks);
881 if (_impl->stopped())
882 {
883 if (_scheduler)
884 _scheduler->pauseTarget(this);
885 }
886
887 for (auto&& task : tasks)
888 {
889 _onDownloadFinished(*task);
890 }
891}
892
893void DownloaderCURL::_updateTaskProgressInfo(DownloadTask& task, int64_t totalExpected)
894{

Callers

nothing calls this directly

Calls 6

getProcessTasksMethod · 0.80
getFinishedTasksMethod · 0.80
stoppedMethod · 0.80
getMethod · 0.45
clearMethod · 0.45
pauseTargetMethod · 0.45

Tested by

no test coverage detected