mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
surface setup issues in EventBeat and Scheduler (#47355)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47355 changelog: [internal] Reviewed By: rshest Differential Revision: D65333695 fbshipit-source-id: 854dbc3ae52db0093961cbeb81f1f96934eca40d
This commit is contained in:
1 parent
4da586ead9
commit
91df5a4a0f
2 files changed
+11
-6
No files matched your search
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "EventBeat.h"
|
||||
|
||||
#include <react/debug/react_native_assert.h>
|
||||
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
||||
#include <utility>
|
||||
|
||||
@@ -18,6 +19,9 @@ EventBeat::EventBeat(
|
||||
: ownerBox_(std::move(ownerBox)), runtimeScheduler_(runtimeScheduler) {}
|
||||
|
||||
void EventBeat::request() const {
|
||||
react_native_assert(
|
||||
beatCallback_ &&
|
||||
"Unexpected state: EventBeat::setBeatCallback was not called before EventBeat::request.");
|
||||
isRequested_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,17 +50,18 @@ Scheduler::Scheduler(
|
||||
auto weakRuntimeScheduler =
|
||||
contextContainer_->find<std::weak_ptr<RuntimeScheduler>>(
|
||||
"RuntimeScheduler");
|
||||
auto runtimeScheduler = weakRuntimeScheduler.has_value()
|
||||
? weakRuntimeScheduler.value().lock()
|
||||
: nullptr;
|
||||
react_native_assert(
|
||||
weakRuntimeScheduler.has_value() &&
|
||||
"Unexpected state: RuntimeScheduler was not provided.");
|
||||
|
||||
if (runtimeScheduler && ReactNativeFeatureFlags::enableUIConsistency()) {
|
||||
auto runtimeScheduler = weakRuntimeScheduler.value().lock();
|
||||
|
||||
if (ReactNativeFeatureFlags::enableUIConsistency()) {
|
||||
runtimeScheduler->setShadowTreeRevisionConsistencyManager(
|
||||
uiManager->getShadowTreeRevisionConsistencyManager());
|
||||
}
|
||||
|
||||
if (runtimeScheduler &&
|
||||
ReactNativeFeatureFlags::enableReportEventPaintTime()) {
|
||||
if (ReactNativeFeatureFlags::enableReportEventPaintTime()) {
|
||||
runtimeScheduler->setEventTimingDelegate(eventPerformanceLogger_.get());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user