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

Method resolveLocalAssetURL

valdi/src/valdi/android/ResourceLoader.cpp:97–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97Valdi::StringBox ResourceLoader::resolveLocalAssetURL(const Valdi::StringBox& moduleName,
98 const Valdi::StringBox& resourcePath) {
99 auto env = JavaEnv();
100 auto javaModuleName = ValdiAndroid::toJavaObject(env, moduleName);
101 auto javaResourcePath = ValdiAndroid::toJavaObject(env, resourcePath);
102 auto resolvedResource =
103 _resolveResourceMethod.call(_localResourceResolver.toObject(), javaModuleName, javaResourcePath);
104 auto value = ValdiAndroid::toValue(env, resolvedResource.stealLocalRef());
105
106 if (!value.isString()) {
107 return Valdi::StringBox();
108 }
109
110 return value.toStringBox();
111}
112
113JavaObject ResourceLoader::requestPayloadFromURL(const JavaObject& imageLoader,
114 const String& url,

Callers 2

Calls 9

toJavaObjectFunction · 0.85
toValueFunction · 0.85
toObjectMethod · 0.80
stealLocalRefMethod · 0.80
callMethod · 0.65
JavaEnvClass · 0.50
StringBoxClass · 0.50
isStringMethod · 0.45
toStringBoxMethod · 0.45

Tested by

no test coverage detected