Fabric: Bunch of code style changes

Summary: Code style only.

Reviewed By: sahrens

Differential Revision: D15681737

fbshipit-source-id: 24cc2e9b9434448026e7cb3cfd274ea14bd835a2
This commit is contained in:
Valentin Shergin
2019-06-07 12:00:01 -07:00
committed by Facebook Github Bot
parent 205de0538c
commit 12c09a2d6c
3 changed files with 53 additions and 67 deletions
@@ -22,12 +22,14 @@ ImageManager::ImageManager(ContextContainer::Shared const &contextContainer)
self_ = (__bridge_retained void *)[[RCTImageManager alloc] initWithImageLoader:imageLoader];
}
ImageManager::~ImageManager() {
ImageManager::~ImageManager()
{
CFRelease(self_);
self_ = nullptr;
}
ImageRequest ImageManager::requestImage(const ImageSource &imageSource) const {
ImageRequest ImageManager::requestImage(const ImageSource &imageSource) const
{
RCTImageManager *imageManager = (__bridge RCTImageManager *)self_;
return [imageManager requestImage:imageSource];
}
+32 -34
View File
@@ -138,25 +138,24 @@ void Scheduler::renderTemplateToSurface(
void Scheduler::stopSurface(SurfaceId surfaceId) const {
SystraceSection s("Scheduler::stopSurface");
shadowTreeRegistry_.visit(
surfaceId, [](const ShadowTree &shadowTree) {
// As part of stopping the Surface, we have to commit an empty tree.
return shadowTree.tryCommit(
[&](const SharedRootShadowNode &oldRootShadowNode) {
return std::make_shared<RootShadowNode>(
*oldRootShadowNode,
ShadowNodeFragment{
/* .tag = */ ShadowNodeFragment::tagPlaceholder(),
/* .surfaceId = */
ShadowNodeFragment::surfaceIdPlaceholder(),
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .eventEmitter = */
ShadowNodeFragment::eventEmitterPlaceholder(),
/* .children = */
ShadowNode::emptySharedShadowNodeSharedList(),
});
});
});
shadowTreeRegistry_.visit(surfaceId, [](const ShadowTree &shadowTree) {
// As part of stopping the Surface, we have to commit an empty tree.
return shadowTree.tryCommit(
[&](const SharedRootShadowNode &oldRootShadowNode) {
return std::make_shared<RootShadowNode>(
*oldRootShadowNode,
ShadowNodeFragment{
/* .tag = */ ShadowNodeFragment::tagPlaceholder(),
/* .surfaceId = */
ShadowNodeFragment::surfaceIdPlaceholder(),
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .eventEmitter = */
ShadowNodeFragment::eventEmitterPlaceholder(),
/* .children = */
ShadowNode::emptySharedShadowNodeSharedList(),
});
});
});
auto shadowTree = shadowTreeRegistry_.remove(surfaceId);
shadowTree->setDelegate(nullptr);
@@ -232,21 +231,20 @@ void Scheduler::uiManagerDidFinishTransaction(
const SharedShadowNodeUnsharedList &rootChildNodes) {
SystraceSection s("Scheduler::uiManagerDidFinishTransaction");
shadowTreeRegistry_.visit(
surfaceId, [&](const ShadowTree &shadowTree) {
shadowTree.commit([&](const SharedRootShadowNode &oldRootShadowNode) {
return std::make_shared<RootShadowNode>(
*oldRootShadowNode,
ShadowNodeFragment{
/* .tag = */ ShadowNodeFragment::tagPlaceholder(),
/* .surfaceId = */ ShadowNodeFragment::surfaceIdPlaceholder(),
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .eventEmitter = */
ShadowNodeFragment::eventEmitterPlaceholder(),
/* .children = */ rootChildNodes,
});
});
});
shadowTreeRegistry_.visit(surfaceId, [&](const ShadowTree &shadowTree) {
shadowTree.commit([&](const SharedRootShadowNode &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(