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

Method setValueForObjectKey

valdi/src/valdi/android/JavaValueDelegate.cpp:77–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void JavaObjectStore::setValueForObjectKey(const JavaValue& objectKey,
78 const Valdi::Ref<Valdi::RefCountable>& value,
79 Valdi::ExceptionTracker& exceptionTracker) {
80 auto& cache = JavaCache::get();
81 auto nativeRef = cache.getNativeRefClass().newObject(
82 cache.getNativeRefConstructorMethod(), reinterpret_cast<int64_t>(Valdi::unsafeBridgeRetain(value.get())));
83 cache.getWeakHashMapPutMethod().call(
84 JavaObject(JavaEnv(), _weakMap.get()), javaValueToObject(objectKey), JavaObject(JavaEnv(), nativeRef.get()));
85}
86
87std::optional<JavaValue> JavaObjectStore::getObjectForId(uint32_t objectId, Valdi::ExceptionTracker& exceptionTracker) {
88 const auto& it = _objectById.find(objectId);

Callers 2

unmarshallInterfaceMethod · 0.45
marshallInterfaceMethod · 0.45

Calls 8

unsafeBridgeRetainFunction · 0.85
javaValueToObjectFunction · 0.85
getMethod · 0.65
callMethod · 0.65
getFunction · 0.50
JavaObjectClass · 0.50
JavaEnvClass · 0.50
newObjectMethod · 0.45

Tested by

no test coverage detected