Pass raw ShadowNode instead of shared_ptr

Summary:
changelog: [internal]

pass raw ShadowNode instead of shared_ptr. Ownership is not transferred, shared_ptr is misleading.

Reviewed By: javache

Differential Revision: D33917010

fbshipit-source-id: 4d9fdd4b4e0376149f1719ad160b957de4afdce3
This commit is contained in:
Samuel Susla authored and Facebook GitHub Bot committed 2022-02-03 04:30:10 -08:00
1 parent 6584304c10
commit 491c4231db
3 files changed
+16 -16

No files matched your search

@@ -94,28 +94,27 @@ SharedShadowNode UIManager::createNode(
}
SharedShadowNode UIManager::cloneNode(
const ShadowNode::Shared &shadowNode,
const SharedShadowNodeSharedList &children,
const RawProps *rawProps) const {
ShadowNode const &shadowNode,
SharedShadowNodeSharedList const &children,
RawProps const *rawProps) const {
SystraceSection s("UIManager::cloneNode");
PropsParserContext propsParserContext{
shadowNode->getFamily().getSurfaceId(), *contextContainer_.get()};
shadowNode.getFamily().getSurfaceId(), *contextContainer_.get()};
auto &componentDescriptor = shadowNode->getComponentDescriptor();
auto &componentDescriptor = shadowNode.getComponentDescriptor();
auto clonedShadowNode = componentDescriptor.cloneShadowNode(
*shadowNode,
shadowNode,
{
/* .props = */
rawProps ? componentDescriptor.cloneProps(
propsParserContext, shadowNode->getProps(), *rawProps)
propsParserContext, shadowNode.getProps(), *rawProps)
: ShadowNodeFragment::propsPlaceholder(),
/* .children = */ children,
});
if (delegate_) {
delegate_->uiManagerDidCloneShadowNode(
*shadowNode.get(), *clonedShadowNode);
delegate_->uiManagerDidCloneShadowNode(shadowNode, *clonedShadowNode);
}
return clonedShadowNode;