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

Method ResourceLoader

valdi/src/valdi/android/ResourceLoader.cpp:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33#endif
34
35void BundledModulesIdentity::set(std::string identity) {
36 std::lock_guard<Valdi::Mutex> guard(_mutex);
37 _identity = std::move(identity);
38}
39
40std::string BundledModulesIdentity::get() {
41 std::lock_guard<Valdi::Mutex> guard(_mutex);
42 return _identity;
43}
44
45ResourceLoader::ResourceLoader(JavaEnv env,
46 jobject localResourceResolver,
47 jobject assetManager,
48 bool shouldDeferModuleLoadToJava,
49 Valdi::Ref<BundledModulesIdentity> bundledModulesIdentity)
50 : _localResourceResolver(env, localResourceResolver, "ResourceResolver"),
51 _assetManagerJava(JavaEnv::newGlobalRef(assetManager)),
52 _shouldDeferModuleLoadToJava(shouldDeferModuleLoadToJava),
53 _bundledModulesIdentity(bundledModulesIdentity != nullptr ? std::move(bundledModulesIdentity) :
54 Valdi::makeShared<BundledModulesIdentity>()) {
55 auto localResourceResolverRef = _localResourceResolver.toObject();
56 auto cls = localResourceResolverRef.getClass();
57 cls.getMethod("getCustomModuleData", _getCustomModuleDataMethod);

Callers

nothing calls this directly

Calls 4

toObjectMethod · 0.80
getMethod · 0.65
getClassMethod · 0.45
getMethodMethod · 0.45

Tested by

no test coverage detected