mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Even though CommitHooks, in general, should be implemented as part of the Core and explicitly registered inside the code, sometimes it's handy to pass specify some additional commit hooks during Scheduler initialization (e.g. hooks that are parts of DevEx tools). Now it's possible. We will use it soon in Timeline feature. Changelog: [Internal] Fabric-specific internal change. Differential Revision: D25920577 fbshipit-source-id: 00f33b7b576c9812afd70c364b5cceb3521da16b
75 lines
2.1 KiB
C++
75 lines
2.1 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 <memory>
|
|
|
|
#include <ReactCommon/RuntimeExecutor.h>
|
|
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
|
|
#include <react/renderer/core/EventBeat.h>
|
|
#include <react/renderer/uimanager/UIManagerCommitHook.h>
|
|
#include <react/renderer/uimanager/primitives.h>
|
|
#include <react/utils/ContextContainer.h>
|
|
#include <react/utils/RunLoopObserver.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* Contains all external dependencies of Scheduler.
|
|
* Copyable.
|
|
*/
|
|
struct SchedulerToolbox final {
|
|
/*
|
|
* Represents general purpose DI container for product components/needs.
|
|
* Must not be `nullptr`.
|
|
*/
|
|
ContextContainer::Shared contextContainer;
|
|
|
|
/*
|
|
* Represents externally managed, lazily available collection of components.
|
|
*/
|
|
ComponentRegistryFactory componentRegistryFactory;
|
|
|
|
/*
|
|
* Represents running JavaScript VM and associated execution queue.
|
|
*/
|
|
RuntimeExecutor runtimeExecutor;
|
|
|
|
/*
|
|
* Represent connections with a platform-specific UI run loops.
|
|
*/
|
|
RunLoopObserver::Factory mainRunLoopObserverFactory;
|
|
|
|
/*
|
|
* Asynchronous & synchronous event beats.
|
|
* Represent connections with the platform-specific run loops and general
|
|
* purpose background queue.
|
|
*/
|
|
EventBeat::Factory asynchronousEventBeatFactory;
|
|
EventBeat::Factory synchronousEventBeatFactory;
|
|
|
|
/*
|
|
* General-purpose executor that is used to dispatch work on some utility
|
|
* queue (mostly) asynchronously to avoid unnecessary blocking the caller
|
|
* queue.
|
|
* The concrete implementation can use a serial or concurrent queue.
|
|
* Due to architectural constraints, the concrete implementation *must* call
|
|
* the call back synchronously if the executor is invoked on the main thread.
|
|
*/
|
|
BackgroundExecutor backgroundExecutor;
|
|
|
|
/*
|
|
* A list of `UIManagerCommitHook`s that should be registered in `UIManager`.
|
|
*/
|
|
std::vector<std::shared_ptr<UIManagerCommitHook const>> commitHooks;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|