Fabric: Inlining Scheduler::uiManagerDidFinishTransaction(surfaceId, rootChildren)

Summary:
There is no need for that functionality to be delegated to Scheduler, that's a leftover of the previous iteration of the design.
Nothing really changed.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18285501

fbshipit-source-id: 4b60445b663a2431fbdc7cc1120f46d56819c430
This commit is contained in:
Valentin Shergin authored and Facebook Github Bot committed 2019-11-06 14:43:42 -08:00
1 parent 04370256e0
commit 1bc4bd333c
4 files changed
+14 -36

No files matched your search

@@ -241,28 +241,6 @@ void Scheduler::uiManagerDidFinishTransaction(
}
}
void Scheduler::uiManagerDidFinishTransaction(
SurfaceId surfaceId,
const SharedShadowNodeUnsharedList &rootChildNodes) {
SystraceSection s("Scheduler::uiManagerDidFinishTransaction");
uiManager_->getShadowTreeRegistry().visit(
surfaceId, [&](const ShadowTree &shadowTree) {
shadowTree.commit([&](RootShadowNode::Shared const &oldRootShadowNode) {
return std::make_shared<RootShadowNode>(
*oldRootShadowNode,
ShadowNodeFragment{
/* .tag = */ ShadowNodeFragment::tagPlaceholder(),
/* .surfaceId = */ ShadowNodeFragment::surfaceIdPlaceholder(),
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .eventEmitter = */
ShadowNodeFragment::eventEmitterPlaceholder(),
/* .children = */ rootChildNodes,
});
});
});
}
void Scheduler::uiManagerDidCreateShadowNode(
const SharedShadowNode &shadowNode) {
SystraceSection s("Scheduler::uiManagerDidCreateShadowNode");
-3
View File
@@ -82,9 +82,6 @@ class Scheduler final : public UIManagerDelegate {
void uiManagerDidFinishTransaction(
MountingCoordinator::Shared const &mountingCoordinator) override;
void uiManagerDidFinishTransaction(
SurfaceId surfaceId,
const SharedShadowNodeUnsharedList &rootChildNodes) override;
void uiManagerDidCreateShadowNode(
const SharedShadowNode &shadowNode) override;
void uiManagerDidDispatchCommand(
+14 -3
View File
@@ -104,9 +104,20 @@ void UIManager::completeSurface(
const SharedShadowNodeUnsharedList &rootChildren) const {
SystraceSection s("UIManager::completeSurface");
if (delegate_) {
delegate_->uiManagerDidFinishTransaction(surfaceId, rootChildren);
}
shadowTreeRegistry_.visit(surfaceId, [&](ShadowTree const &shadowTree) {
shadowTree.commit([&](RootShadowNode::Shared const &oldRootShadowNode) {
return std::make_shared<RootShadowNode>(
*oldRootShadowNode,
ShadowNodeFragment{
/* .tag = */ ShadowNodeFragment::tagPlaceholder(),
/* .surfaceId = */ ShadowNodeFragment::surfaceIdPlaceholder(),
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .eventEmitter = */
ShadowNodeFragment::eventEmitterPlaceholder(),
/* .children = */ rootChildren,
});
});
});
}
void UIManager::setJSResponder(
@@ -26,14 +26,6 @@ class UIManagerDelegate {
virtual void uiManagerDidFinishTransaction(
MountingCoordinator::Shared const &mountingCoordinator) = 0;
/*
* Called right after the new/updated Shadow Node tree is constructed.
* The tree is not laid 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
* might use this to optimistically allocate a new native view