MCPcopy Create free account
hub / github.com/defold/defold / AddMountProcess

Function AddMountProcess

engine/liveupdate/src/liveupdate.cpp:138–168  ·  view source on GitHub ↗

Called on the worker thread

Source from the content-addressed store, hash-verified

136
137 // Called on the worker thread
138 static int AddMountProcess(HJobContext context, HJob hjob, LiveUpdateCtx* jobctx, AddMountInfo* job)
139 {
140 dmURI::Parts uri;
141 dmURI::Parse(job->m_Uri, &uri);
142
143 dmResourceProvider::HArchiveLoader loader = dmResourceProvider::FindLoaderByName(dmHashString64(uri.m_Scheme));
144 if (!loader)
145 {
146 dmLogError("Failed to find loader for scheme '%s'", uri.m_Scheme);
147 return RESULT_IO_ERROR;
148 }
149
150 dmResourceProvider::HArchive archive = 0;
151 dmResourceProvider::Result result = dmResourceProvider::CreateMount(loader, &uri, jobctx->m_ResourceBaseArchive, &archive);
152 if (dmResourceProvider::RESULT_OK != result)
153 {
154 dmLogError("Failed to create new mount from %s", job->m_Uri);
155 return RESULT_UNKNOWN;
156 }
157
158 if (archive)
159 {
160 dmResource::Result result = dmResourceMounts::AddMount(jobctx->m_ResourceMounts, job->m_NameHash, archive, job->m_Priority);
161 if (dmResource::RESULT_OK != result)
162 {
163 dmLogError("Failed to add mount for '%s': %s", job->m_Uri, dmResource::ResultToString(result));
164 }
165 }
166
167 return RESULT_OK;
168 }
169
170 // Called on the main thread (see JobSystemUpdate below)
171 static void AddMountFinished(HJobContext context, HJob hjob, JobSystemStatus status, LiveUpdateCtx* jobctx, AddMountInfo* job, int result)

Callers

nothing calls this directly

Calls 5

FindLoaderByNameFunction · 0.85
CreateMountFunction · 0.85
AddMountFunction · 0.85
ResultToStringFunction · 0.70
ParseFunction · 0.50

Tested by

no test coverage detected