Mark subclasses of ShadowNode final when appropriate

Summary:
Changelog: [internal]

These ShadowNode subclasses should not be further subclassed. compiler can produce smaller and faster code.

Reviewed By: JoshuaGross

Differential Revision: D27463255

fbshipit-source-id: cb10cc61a3d80731476ac0c51af7f9a47e3f9ab7
This commit is contained in:
Samuel Susla 2021-03-31 10:57:21 -07:00 коммит произвёл Facebook GitHub Bot
Родитель faec9cd4ce
Коммит 1e690ac457
4 изменённых файлов: 22 добавлений и 22 удалений

Просмотреть файл

@ -28,12 +28,12 @@ extern char const ParagraphComponentName[];
* containing and displaying text. Text content is represented as nested <Text>
* and <RawText> components.
*/
class ParagraphShadowNode : public ConcreteViewShadowNode<
ParagraphComponentName,
ParagraphProps,
ParagraphEventEmitter,
ParagraphState>,
public BaseTextShadowNode {
class ParagraphShadowNode final : public ConcreteViewShadowNode<
ParagraphComponentName,
ParagraphProps,
ParagraphEventEmitter,
ParagraphState>,
public BaseTextShadowNode {
public:
using ConcreteViewShadowNode::ConcreteViewShadowNode;

Просмотреть файл

@ -24,11 +24,11 @@ extern const char AndroidTextInputComponentName[];
/*
* `ShadowNode` for <AndroidTextInput> component.
*/
class AndroidTextInputShadowNode : public ConcreteViewShadowNode<
AndroidTextInputComponentName,
AndroidTextInputProps,
AndroidTextInputEventEmitter,
AndroidTextInputState> {
class AndroidTextInputShadowNode final : public ConcreteViewShadowNode<
AndroidTextInputComponentName,
AndroidTextInputProps,
AndroidTextInputEventEmitter,
AndroidTextInputState> {
public:
static ShadowNodeTraits BaseTraits() {
auto traits = ConcreteViewShadowNode::BaseTraits();

Просмотреть файл

@ -24,12 +24,12 @@ extern const char TextInputComponentName[];
/*
* `ShadowNode` for <TextInput> component.
*/
class TextInputShadowNode : public ConcreteViewShadowNode<
TextInputComponentName,
TextInputProps,
TextInputEventEmitter,
TextInputState>,
public BaseTextShadowNode {
class TextInputShadowNode final : public ConcreteViewShadowNode<
TextInputComponentName,
TextInputProps,
TextInputEventEmitter,
TextInputState>,
public BaseTextShadowNode {
public:
using ConcreteViewShadowNode::ConcreteViewShadowNode;

Просмотреть файл

@ -45,11 +45,11 @@ class TestShadowNode;
using SharedTestShadowNode = std::shared_ptr<const TestShadowNode>;
class TestShadowNode : public ConcreteViewShadowNode<
TestComponentName,
TestProps,
ViewEventEmitter,
TestState> {
class TestShadowNode final : public ConcreteViewShadowNode<
TestComponentName,
TestProps,
ViewEventEmitter,
TestState> {
public:
using ConcreteViewShadowNode::ConcreteViewShadowNode;