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

Method getAllContexts

valdi/src/valdi/android/NativeBridge.cpp:1959–1978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1957
1958 auto javaEnv = ValdiAndroid::JavaEnv();
1959
1960 auto cppViewClassName = ValdiAndroid::toInternedString(javaEnv, viewClassName);
1961
1962 auto viewFactoryObject = ValdiAndroid::GlobalRefJavaObjectBase(javaEnv, viewFactory, "ViewFactory");
1963
1964 auto attributes = viewManagerContext->getAttributesManager().getAttributesForClass(cppViewClassName);
1965
1966 if (hasBindAttributes == JNI_TRUE) {
1967 Valdi::AttributesBindingContextImpl bindingContext(viewManagerContext->getAttributesManager().getAttributeIds(),
1968 viewManagerContext->getAttributesManager().getColorPalette(),
1969 runtimeManagerWrapper->getRuntimeManager().getLogger());
1970
1971 auto wrapper = Valdi::makeShared<AttributesBindingContextWrapper>(androidViewManager, bindingContext);
1972 auto ptr = reinterpret_cast<int64_t>(Valdi::unsafeBridgeCast(wrapper.get()));
1973
1974 ValdiAndroid::JavaEnv::getCache().getViewFactoryBindAttributesMethod().call(viewFactoryObject.toObject(), ptr);
1975
1976 attributes = attributes->merge(cppViewClassName,
1977 bindingContext.getHandlers(),
1978 bindingContext.getDefaultDelegate(),
1979 bindingContext.getMeasureDelegate(),
1980 bindingContext.scrollAttributesBound(),
1981 true);

Callers 2

setupJsRuntimeMethod · 0.45

Calls 10

getRuntimeFunction · 0.85
toJavaObjectFunction · 0.85
getUserDataMethod · 0.80
appendMethod · 0.65
releaseObjectMethod · 0.65
ValueClass · 0.50
JavaEnvClass · 0.50
reserveMethod · 0.45
sizeMethod · 0.45
buildMethod · 0.45

Tested by 1