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

Method createSnapDrawingRoot

valdi/src/valdi/android/NativeBridge.cpp:2140–2151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2138 auto bundle = runtimeWrapper->getRuntime().getResourceManager().getBundle(moduleNameCpp);
2139 auto entry = bundle->getEntry(pathCpp);
2140 if (!entry) {
2141 return nullptr;
2142 }
2143
2144 if (saveToDisk != 0) {
2145 Valdi::Path path(".valdi_extracted_module");
2146 path.append(moduleNameCpp.toStringView()).append(pathCpp.toStringView());
2147 const auto& diskCache = runtimeWrapper->getRuntime().getDiskCache();
2148 auto result = diskCache->store(path, entry.value());
2149 if (!result) {
2150 ValdiAndroid::throwJavaValdiException(fbjni::Environment::current(), result.error());
2151 return nullptr;
2152 }
2153
2154 auto filePath = diskCache->getAbsoluteURL(path).substring(std::string_view("file://").length());

Callers

nothing calls this directly

Calls 4

getSnapDrawingRuntimeFunction · 0.85
unsafeBridgeRetainFunction · 0.85
createHostMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected