From b241bc2d0ba41ff91408568950f0863020d4f3a6 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 14 May 2019 19:47:27 -0700 Subject: [PATCH] Fabric: Removing `MainQueueExecutor` Summary: We don't need it anymore because we don't use folly::Future. Reviewed By: JoshuaGross Differential Revision: D15344961 fbshipit-source-id: a368e600d69e6879f6a98b4a997de85c71186e92 --- .../Image/RCTImageComponentView.mm | 1 - .../Slider/RCTSliderComponentView.mm | 2 -- React/Fabric/Utils/MainQueueExecutor.h | 21 ------------- React/Fabric/Utils/MainQueueExecutor.mm | 31 ------------------- 4 files changed, 55 deletions(-) delete mode 100644 React/Fabric/Utils/MainQueueExecutor.h delete mode 100644 React/Fabric/Utils/MainQueueExecutor.mm diff --git a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index cb38882cea4..ad8231d4fa0 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -15,7 +15,6 @@ #import #import -#import "MainQueueExecutor.h" #import "RCTConversions.h" @implementation RCTImageComponentView { diff --git a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm index 0850789a0b1..f71ab528394 100644 --- a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm @@ -13,8 +13,6 @@ #import #import -#import "MainQueueExecutor.h" - using namespace facebook::react; @implementation RCTSliderComponentView { diff --git a/React/Fabric/Utils/MainQueueExecutor.h b/React/Fabric/Utils/MainQueueExecutor.h deleted file mode 100644 index 5864e58e8e6..00000000000 --- a/React/Fabric/Utils/MainQueueExecutor.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 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. - */ - -#include - -namespace facebook { -namespace react { - -class MainQueueExecutor : public folly::Executor { - public: - static MainQueueExecutor &instance(); - - void add(folly::Func function) override; -}; - -} // namespace react -} // namespace facebook diff --git a/React/Fabric/Utils/MainQueueExecutor.mm b/React/Fabric/Utils/MainQueueExecutor.mm deleted file mode 100644 index 55749261d15..00000000000 --- a/React/Fabric/Utils/MainQueueExecutor.mm +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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. - */ - -#include "MainQueueExecutor.h" - -#include -#include - -namespace facebook { -namespace react { - -MainQueueExecutor &MainQueueExecutor::instance() -{ - static auto instance = folly::Indestructible{}; - return *instance; -} - -void MainQueueExecutor::add(folly::Func function) -{ - __block folly::Func blockFunction = std::move(function); - dispatch_async(dispatch_get_main_queue(), ^{ - blockFunction(); - }); -} - -} // namespace react -} // namespace facebook