MCPcopy Create free account
hub / github.com/Snapchat/Valdi / populateSourceMap

Method populateSourceMap

valdi/src/valdi/runtime/Resources/ResourceManager.cpp:390–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388 if (!archiveResult) {
389 if (!_hotReloaderEnabled) {
390 VALDI_ERROR(_logger, "Failed to load archive of Module '{}': {}", bundleName, archiveResult.error());
391 }
392 initializeBundle(bundleInitializer, makeShared<ValdiModuleArchive>());
393 } else {
394 hasAssetPackage = inlineAssetsEnabled && archiveResult.value()->containsEntry(assetPackageKey);
395 initializeBundle(bundleInitializer, archiveResult.value());
396 }
397
398 populateSourceMap(bundleName, *bundleInitializer.getBundle());
399
400 if (hasAssetPackage) {
401 insertAssetPackageInBundle(bundleInitializer.getBundle(),
402 bundleInitializer.getBundle()->getEntry(assetPackageKey).value());
403 }
404
405 if (Valdi::traceLoadModules) {
406 VALDI_INFO(_logger, "Loaded bundle '{}' in {}", bundleName, sw.elapsed());
407 }
408
409 return bundleInitializer.getBundle();
410}
411
412/**
413 * Returns the list of all loaded bundle names.
414 * Returns:
415 * - A vector of all loaded bundle names.
416 */
417std::vector<StringBox> ResourceManager::getAllLoadedBundleNames() const {
418 std::lock_guard<Mutex> guard(_mutex);
419 std::vector<StringBox> result;
420 result.reserve(_bundleByName.size());
421 for (const auto& it : _bundleByName) {
422 result.push_back(it.first);
423 }

Callers

nothing calls this directly

Calls 15

resolveSourceMapFilePathFunction · 0.85
JavaScriptFileClass · 0.85
hasPrefixMethod · 0.80
hasSuffixMethod · 0.80
substringMethod · 0.80
getJsMethod · 0.80
setJsMethod · 0.80
valueMethod · 0.65
appendMethod · 0.65
getMapMethod · 0.65
jsonToValueFunction · 0.50
loadModuleContentMethod · 0.45

Tested by

no test coverage detected