Valentin Shergin b4fa1fa0c6 Fabric: Introducing ShadowTreeRegistry
Summary:
Why do we need a dedicated registry class?
* We need to simplify registry-related logic in Scheduler.
* We need to couple threading aspect of the registry with the registry itself, otherwise it's not clear why exactly we acquire the mutex. We also should not acquire the mutex in a per-method way (as we did before), because it's incorrect and misleading (only lines that access the registry should by protected).
* We need to have a way to share the registry with other classes (e.g. UIManager) without passing a reference to the whole Scheduler.

Reviewed By: mdvacca

Differential Revision: D13036550

fbshipit-source-id: 644da910e823666c586834a3da2b4cdcb90eebb2
2018-11-21 17:16:48 -08:00

42 lines
1.0 KiB
C++

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/core/ReactPrimitives.h>
#include <react/core/ShadowNode.h>
namespace facebook {
namespace react {
/*
* Abstract class for UIManager's delegate.
*/
class UIManagerDelegate {
public:
/*
* Called right after the new/updated Shadow Node tree is constructed.
* The tree is not layed out and not sealed at this time.
*/
virtual void uiManagerDidFinishTransaction(
SurfaceId surfaceId,
const SharedShadowNodeUnsharedList &rootChildNodes) = 0;
/*
* Called each time when UIManager constructs a new Shadow Node. Receiver
* maight use this to preluminary optimistically allocate a new native view
* instances.
*/
virtual void uiManagerDidCreateShadowNode(
const SharedShadowNode &shadowNode) = 0;
virtual ~UIManagerDelegate() noexcept = default;
};
} // namespace react
} // namespace facebook