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

Method getRetainedViewNodeChildren

valdi/src/valdi/android/NativeBridge.cpp:657–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655 ValdiAndroid::throwJavaValdiException(env, nodePathResult.error());
656 return 0;
657 }
658
659 viewNode = viewNodeTree->getViewNodeForNodePath(nodePathResult.value());
660 } else {
661 if (viewNodeId == kRootViewNodeIdSentinel) {
662 viewNode = viewNodeTree->getRootViewNode();
663 } else {
664 viewNode = viewNodeTree->getViewNode(static_cast<Valdi::RawViewNodeId>(viewNodeId));
665 }
666 }
667
668 return ValdiAndroid::bridgeRetain(viewNode.get());
669}
670
671jobject ValdiAndroid::NativeBridge::getRetainedViewNodeChildren( // NOLINT
672 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT
673 jlong viewNodeHandle,
674 jint mode) {
675 static constexpr jint kModeChildrenShallowAll = 1;
676 static constexpr jint kModeChildrenShallowVisible = 2;
677
678 auto viewNode = getViewNode(viewNodeHandle);
679 if (viewNode == nullptr) {
680 return nullptr;
681 }
682
683 std::vector<jlong> childrenHandles;
684
685 bool modeShallowAll = mode == kModeChildrenShallowAll;
686 bool modeShallowVisible = mode == kModeChildrenShallowVisible;
687 if (modeShallowAll || modeShallowVisible) {
688 auto size = viewNode->getChildCount();
689 childrenHandles.reserve(size);

Callers

nothing calls this directly

Calls 11

getViewNodeFunction · 0.85
bridgeRetainFunction · 0.85
toJavaLongArrayFunction · 0.85
isVisibleInViewportMethod · 0.80
releaseObjectMethod · 0.65
JavaEnvClass · 0.50
getChildCountMethod · 0.45
reserveMethod · 0.45
getChildAtMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected