From d04e03ffb8f33dbffe8adada94eb0c624722329f Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 7 Nov 2019 09:41:11 -0800 Subject: [PATCH] Fabric: Making `EventBeat::beat` protected member Summary: The documentation for the method says that it must be called from a subclass, but the methods wasn't marked as protected. Calling `beat` directly will bypass custom logic implemented in subclasses (because it's not a virtual function (by-design)). That's practically what happened before and what the previous diffs in the stack fix. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D18339594 fbshipit-source-id: 3d8c53b69e1b72d447714dd91c9392bdfb05b9ae --- ReactCommon/fabric/core/events/EventBeat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/core/events/EventBeat.h b/ReactCommon/fabric/core/events/EventBeat.h index 63dacb91eac..1e20c2ec937 100644 --- a/ReactCommon/fabric/core/events/EventBeat.h +++ b/ReactCommon/fabric/core/events/EventBeat.h @@ -75,13 +75,13 @@ class EventBeat { */ void setBeatCallback(const BeatCallback &beatCallback); + protected: /* * Should be used by sublasses to send a beat. * Receiver might ignore the call if a beat was not requested. */ void beat(jsi::Runtime &runtime) const; - protected: BeatCallback beatCallback_; SharedOwnerBox ownerBox_; mutable std::atomic isRequested_{false};