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

Method createViewNodeWrapper

valdi/src/valdi/android/ViewManager.cpp:248–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248Valdi::Value ViewManager::createViewNodeWrapper(const Valdi::Ref<Valdi::ViewNode>& viewNode,
249 bool wrapInPlatformReference) {
250 auto javaValdiContext = viewNode->getViewNodeTree()->getContext()->getUserData();
251 if (javaValdiContext == nullptr) {
252 // This can happen if the context was destroyed. We return undefined in this case.
253 return Valdi::Value::undefined();
254 }
255
256 auto viewNodeWrapper =
257 _createViewNodeWrapperMethod.call(toObject(),
258 fromValdiContextUserData(javaValdiContext),
259 reinterpret_cast<int64_t>(Valdi::unsafeBridgeRetain(viewNode.get())),
260 wrapInPlatformReference);
261
262 return Valdi::Value(valdiObjectFromJavaObject(viewNodeWrapper, "ViewNode"));
263}
264
265int64_t ViewManager::measure(const JavaObject& measureDelegate,
266 int64_t attributesHandle,

Callers 1

Calls 10

toObjectFunction · 0.85
fromValdiContextUserDataFunction · 0.85
unsafeBridgeRetainFunction · 0.85
getUserDataMethod · 0.80
getViewNodeTreeMethod · 0.80
callMethod · 0.65
getMethod · 0.65
ValueClass · 0.50
getContextMethod · 0.45

Tested by

no test coverage detected