mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Replace usage of SharedShadowNode for ShadowNode::Shared
Summary: ShadowNode::Shared and SharedShadowNode represent the exact same type. Nowadays we use ShadowNode::Shared instead of SharedShadowNode. This diff replaces usages of SharedShadowNode for ShadowNode::Shared in the fabric folder. Changelog: [internal] Reviewed By: shergin Differential Revision: D19217717 fbshipit-source-id: 112331b22251aa3a3d5e183395c54f2ca0f56e47
This commit is contained in:
committed by
Facebook Github Bot
parent
de95457b8f
commit
4bfe8937b6
@@ -84,7 +84,7 @@ class ConcreteViewShadowNode : public ConcreteShadowNode<
|
||||
}
|
||||
};
|
||||
|
||||
void appendChild(const SharedShadowNode &child) {
|
||||
void appendChild(const ShadowNode::Shared &child) {
|
||||
ensureUnsealed();
|
||||
|
||||
ShadowNode::appendChild(child);
|
||||
|
||||
@@ -90,8 +90,8 @@ class ComponentDescriptor {
|
||||
* Appends (by mutating) a given `childShadowNode` to `parentShadowNode`.
|
||||
*/
|
||||
virtual void appendChild(
|
||||
const SharedShadowNode &parentShadowNode,
|
||||
const SharedShadowNode &childShadowNode) const = 0;
|
||||
const ShadowNode::Shared &parentShadowNode,
|
||||
const ShadowNode::Shared &childShadowNode) const = 0;
|
||||
|
||||
/*
|
||||
* Creates a new `Props` of a particular type with all values copied from
|
||||
|
||||
@@ -88,8 +88,8 @@ class ConcreteComponentDescriptor : public ComponentDescriptor {
|
||||
}
|
||||
|
||||
void appendChild(
|
||||
const SharedShadowNode &parentShadowNode,
|
||||
const SharedShadowNode &childShadowNode) const override {
|
||||
const ShadowNode::Shared &parentShadowNode,
|
||||
const ShadowNode::Shared &childShadowNode) const override {
|
||||
assert(
|
||||
dynamic_cast<ConcreteShadowNode const *>(parentShadowNode.get()) &&
|
||||
"Provided `parentShadowNode` has an incompatible type.");
|
||||
|
||||
@@ -156,7 +156,7 @@ void ShadowNode::sealRecursive() const {
|
||||
|
||||
#pragma mark - Mutating Methods
|
||||
|
||||
void ShadowNode::appendChild(const SharedShadowNode &child) {
|
||||
void ShadowNode::appendChild(const ShadowNode::Shared &child) {
|
||||
ensureUnsealed();
|
||||
|
||||
cloneChildrenIfShared();
|
||||
|
||||
@@ -51,7 +51,7 @@ class ComponentDescriptorRegistry {
|
||||
ComponentDescriptor const &at(std::string const &componentName) const;
|
||||
ComponentDescriptor const &at(ComponentHandle componentHandle) const;
|
||||
|
||||
SharedShadowNode createNode(
|
||||
ShadowNode::Shared createNode(
|
||||
Tag tag,
|
||||
std::string const &viewName,
|
||||
SurfaceId surfaceId,
|
||||
|
||||
@@ -285,7 +285,7 @@ void Scheduler::uiManagerDidFinishTransaction(
|
||||
}
|
||||
|
||||
void Scheduler::uiManagerDidCreateShadowNode(
|
||||
const SharedShadowNode &shadowNode) {
|
||||
const ShadowNode::Shared &shadowNode) {
|
||||
SystraceSection s("Scheduler::uiManagerDidCreateShadowNode");
|
||||
|
||||
if (delegate_) {
|
||||
@@ -296,7 +296,7 @@ void Scheduler::uiManagerDidCreateShadowNode(
|
||||
}
|
||||
|
||||
void Scheduler::uiManagerDidDispatchCommand(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
std::string const &commandName,
|
||||
folly::dynamic const args) {
|
||||
SystraceSection s("Scheduler::uiManagerDispatchCommand");
|
||||
@@ -312,7 +312,7 @@ void Scheduler::uiManagerDidDispatchCommand(
|
||||
*/
|
||||
void Scheduler::uiManagerDidSetJSResponder(
|
||||
SurfaceId surfaceId,
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
bool blockNativeResponder) {
|
||||
if (delegate_) {
|
||||
// TODO: the first shadowView paramenter, should be the first parent that
|
||||
|
||||
@@ -90,14 +90,14 @@ class Scheduler final : public UIManagerDelegate {
|
||||
void uiManagerDidFinishTransaction(
|
||||
MountingCoordinator::Shared const &mountingCoordinator) override;
|
||||
void uiManagerDidCreateShadowNode(
|
||||
const SharedShadowNode &shadowNode) override;
|
||||
const ShadowNode::Shared &shadowNode) override;
|
||||
void uiManagerDidDispatchCommand(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
std::string const &commandName,
|
||||
folly::dynamic const args) override;
|
||||
void uiManagerDidSetJSResponder(
|
||||
SurfaceId surfaceId,
|
||||
const SharedShadowNode &shadowView,
|
||||
const ShadowNode::Shared &shadowView,
|
||||
bool blockNativeResponder) override;
|
||||
void uiManagerDidClearJSResponder() override;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ SharedShadowNode UIManager::createNode(
|
||||
}
|
||||
|
||||
SharedShadowNode UIManager::cloneNode(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
const SharedShadowNodeSharedList &children,
|
||||
const RawProps *rawProps) const {
|
||||
SystraceSection s("UIManager::cloneNode");
|
||||
@@ -95,8 +95,8 @@ SharedShadowNode UIManager::cloneNode(
|
||||
}
|
||||
|
||||
void UIManager::appendChild(
|
||||
const SharedShadowNode &parentShadowNode,
|
||||
const SharedShadowNode &childShadowNode) const {
|
||||
const ShadowNode::Shared &parentShadowNode,
|
||||
const ShadowNode::Shared &childShadowNode) const {
|
||||
SystraceSection s("UIManager::appendChild");
|
||||
|
||||
auto &componentDescriptor = parentShadowNode->getComponentDescriptor();
|
||||
@@ -121,7 +121,7 @@ void UIManager::completeSurface(
|
||||
}
|
||||
|
||||
void UIManager::setJSResponder(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
const bool blockNativeResponder) const {
|
||||
if (delegate_) {
|
||||
delegate_->uiManagerDidSetJSResponder(
|
||||
@@ -217,7 +217,7 @@ void UIManager::updateState(
|
||||
}
|
||||
|
||||
void UIManager::dispatchCommand(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
std::string const &commandName,
|
||||
folly::dynamic const args) const {
|
||||
if (delegate_) {
|
||||
|
||||
@@ -59,21 +59,21 @@ class UIManager final : public ShadowTreeDelegate {
|
||||
friend class UIManagerBinding;
|
||||
friend class Scheduler;
|
||||
|
||||
SharedShadowNode createNode(
|
||||
ShadowNode::Shared createNode(
|
||||
Tag tag,
|
||||
std::string const &componentName,
|
||||
SurfaceId surfaceId,
|
||||
const RawProps &props,
|
||||
SharedEventTarget eventTarget) const;
|
||||
|
||||
SharedShadowNode cloneNode(
|
||||
const SharedShadowNode &shadowNode,
|
||||
ShadowNode::Shared cloneNode(
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
const SharedShadowNodeSharedList &children = nullptr,
|
||||
const RawProps *rawProps = nullptr) const;
|
||||
|
||||
void appendChild(
|
||||
const SharedShadowNode &parentShadowNode,
|
||||
const SharedShadowNode &childShadowNode) const;
|
||||
const ShadowNode::Shared &parentShadowNode,
|
||||
const ShadowNode::Shared &childShadowNode) const;
|
||||
|
||||
void completeSurface(
|
||||
SurfaceId surfaceId,
|
||||
@@ -83,7 +83,7 @@ class UIManager final : public ShadowTreeDelegate {
|
||||
const;
|
||||
|
||||
void setJSResponder(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
const bool blockNativeResponder) const;
|
||||
|
||||
void clearJSResponder() const;
|
||||
@@ -111,7 +111,7 @@ class UIManager final : public ShadowTreeDelegate {
|
||||
StateData::Shared const &rawStateData) const;
|
||||
|
||||
void dispatchCommand(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
std::string const &commandName,
|
||||
folly::dynamic const args) const;
|
||||
|
||||
|
||||
@@ -32,13 +32,13 @@ class UIManagerDelegate {
|
||||
* instances.
|
||||
*/
|
||||
virtual void uiManagerDidCreateShadowNode(
|
||||
const SharedShadowNode &shadowNode) = 0;
|
||||
const ShadowNode::Shared &shadowNode) = 0;
|
||||
|
||||
/*
|
||||
* Called when UIManager wants to dispatch a command to the mounting layer.
|
||||
*/
|
||||
virtual void uiManagerDidDispatchCommand(
|
||||
const SharedShadowNode &shadowNode,
|
||||
const ShadowNode::Shared &shadowNode,
|
||||
std::string const &commandName,
|
||||
folly::dynamic const args) = 0;
|
||||
|
||||
@@ -47,7 +47,7 @@ class UIManagerDelegate {
|
||||
*/
|
||||
virtual void uiManagerDidSetJSResponder(
|
||||
SurfaceId surfaceId,
|
||||
SharedShadowNode const &shadowView,
|
||||
ShadowNode::Shared const &shadowView,
|
||||
bool blockNativeResponder) = 0;
|
||||
|
||||
/*
|
||||
|
||||
@@ -44,7 +44,7 @@ class NativeModuleRegistry {
|
||||
|
||||
class UITemplateProcessor {
|
||||
public:
|
||||
static SharedShadowNode buildShadowTree(
|
||||
static ShadowNode::Shared buildShadowTree(
|
||||
const std::string &jsonStr,
|
||||
int rootTag,
|
||||
const folly::dynamic ¶ms,
|
||||
@@ -53,7 +53,7 @@ class UITemplateProcessor {
|
||||
const std::shared_ptr<const ReactNativeConfig> reactNativeConfig);
|
||||
|
||||
private:
|
||||
static SharedShadowNode runCommand(
|
||||
static ShadowNode::Shared runCommand(
|
||||
const folly::dynamic &command,
|
||||
Tag rootTag,
|
||||
std::vector<SharedShadowNode> &nodes,
|
||||
|
||||
@@ -27,7 +27,7 @@ struct ShadowNodeWrapper : public jsi::HostObject {
|
||||
ShadowNodeWrapper(SharedShadowNode shadowNode)
|
||||
: shadowNode(std::move(shadowNode)) {}
|
||||
|
||||
SharedShadowNode shadowNode;
|
||||
ShadowNode::Shared shadowNode;
|
||||
};
|
||||
|
||||
struct ShadowNodeListWrapper : public jsi::HostObject {
|
||||
@@ -37,7 +37,7 @@ struct ShadowNodeListWrapper : public jsi::HostObject {
|
||||
SharedShadowNodeUnsharedList shadowNodeList;
|
||||
};
|
||||
|
||||
inline static SharedShadowNode shadowNodeFromValue(
|
||||
inline static ShadowNode::Shared shadowNodeFromValue(
|
||||
jsi::Runtime &runtime,
|
||||
const jsi::Value &value) {
|
||||
return value.getObject(runtime)
|
||||
@@ -47,7 +47,7 @@ inline static SharedShadowNode shadowNodeFromValue(
|
||||
|
||||
inline static jsi::Value valueFromShadowNode(
|
||||
jsi::Runtime &runtime,
|
||||
const SharedShadowNode &shadowNode) {
|
||||
const ShadowNode::Shared &shadowNode) {
|
||||
return jsi::Object::createFromHostObject(
|
||||
runtime, std::make_shared<ShadowNodeWrapper>(shadowNode));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user