Skip to content

Commit

Permalink
Make EventQueue a virtual class
Browse files Browse the repository at this point in the history
Summary:
Changelog: [internal]

EventQueue is used as a virtual class, this diff makes it one.

Reviewed By: JoshuaGross, shergin

Differential Revision: D25826983

fbshipit-source-id: 60e6937514cd3b837b0ca9f61bfaa081823ffc61
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Jan 7, 2021
1 parent f2052fe commit deda351
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions ReactCommon/react/renderer/core/BatchedEventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ BatchedEventQueue::BatchedEventQueue(
: EventQueue(eventPipe, statePipe, std::move(eventBeat)) {}

void BatchedEventQueue::onEnqueue() const {
EventQueue::onEnqueue();

eventBeat_->request();
}

Expand Down
4 changes: 0 additions & 4 deletions ReactCommon/react/renderer/core/EventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ void EventQueue::enqueueStateUpdate(const StateUpdate &stateUpdate) const {
onEnqueue();
}

void EventQueue::onEnqueue() const {
// Default implementation does nothing.
}

void EventQueue::onBeat(jsi::Runtime &runtime) const {
flushEvents(runtime);
flushStateUpdates();
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/react/renderer/core/EventQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class EventQueue {
* Override in subclasses to trigger beat `request` and/or beat `induce`.
* Default implementation does nothing.
*/
virtual void onEnqueue() const;
virtual void onEnqueue() const = 0;
void onBeat(jsi::Runtime &runtime) const;

void flushEvents(jsi::Runtime &runtime) const;
Expand Down
2 changes: 0 additions & 2 deletions ReactCommon/react/renderer/core/UnbatchedEventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ namespace facebook {
namespace react {

void UnbatchedEventQueue::onEnqueue() const {
EventQueue::onEnqueue();

eventBeat_->request();
eventBeat_->induce();
}
Expand Down

0 comments on commit deda351

Please sign in to comment.