mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
79d5b20ced
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28730 Moving RuntimeExecutor out of react/utils and into its own subdir of ReactCommon. I'm doing this because I'm going to be pulling this into CatalystInstance on Android, and I don't want to pull in all the files we don't need there; also, this should hopefully make the OSS NDK stuff easier (this uses the react/utils prefix to export, and I'm not sure if you can include a '/' in a gradle module name?) Changelog: [Internal] Reviewed By: shergin, mdvacca Differential Revision: D21098528 fbshipit-source-id: 9fbd72901ece522b1caec3ec34fafb8f9b327275
40 lines
931 B
C++
40 lines
931 B
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 <CoreFoundation/CFRunLoop.h>
|
|
#include <CoreFoundation/CoreFoundation.h>
|
|
#include <ReactCommon/RuntimeExecutor.h>
|
|
#include <react/core/EventBeat.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* Event beat associated with main run loop cycle.
|
|
* The callback is always called on the main thread.
|
|
*/
|
|
class MainRunLoopEventBeat final : public EventBeat {
|
|
public:
|
|
MainRunLoopEventBeat(
|
|
EventBeat::SharedOwnerBox const &ownerBox,
|
|
RuntimeExecutor runtimeExecutor);
|
|
~MainRunLoopEventBeat();
|
|
|
|
void induce() const override;
|
|
|
|
private:
|
|
void lockExecutorAndBeat() const;
|
|
|
|
const RuntimeExecutor runtimeExecutor_;
|
|
CFRunLoopObserverRef mainRunLoopObserver_;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|