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

Method scheduleExclusiveUpdate

valdi/src/valdi/android/NativeBridge.cpp:807–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

805}
806
807void ValdiAndroid::NativeBridge::scheduleExclusiveUpdate( // NOLINT
808 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT
809 jlong contextHandle,
810 jobject runnable) {
811 auto viewNodeTree = getViewNodeTree(contextHandle);
812
813 if (viewNodeTree == nullptr) {
814 return;
815 }
816
817 auto runnableRef = Valdi::makeShared<ValdiAndroid::JavaRunnable>(ValdiAndroid::JavaEnv(), runnable);
818
819#if VALDI_DEBUG_TREE_UPDATES
820 viewNodeTree->scheduleExclusiveUpdate(
821 [runnableRef = std::move(runnableRef)]() { (*runnableRef)(); }, Valdi::DispatchFunction(), "native_bridge");
822#else
823 viewNodeTree->scheduleExclusiveUpdate([runnableRef = std::move(runnableRef)]() { (*runnableRef)(); },
824 Valdi::DispatchFunction());
825#endif
826}
827
828void ValdiAndroid::NativeBridge::setViewInflationEnabled( // NOLINT
829 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT

Callers 2

TEST_PFunction · 0.45
TESTFunction · 0.45

Calls 3

getViewNodeTreeFunction · 0.85
DispatchFunctionClass · 0.85
JavaEnvClass · 0.50

Tested by 2

TEST_PFunction · 0.36
TESTFunction · 0.36