Skip to content

Commit

Permalink
Abandon mc react_fabric.enable_event_emitter_wrapper_raw_pointer
Browse files Browse the repository at this point in the history
Summary:
changelog: [internal]

Remove gating.

Reviewed By: philIip

Differential Revision: D33944220

fbshipit-source-id: bba076a2166f8d676119d5c069a3894e3d547285
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Feb 3, 2022
1 parent 491c423 commit 4cbcb7a
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ Binding::getInspectorDataForInstance(
}

EventEmitterWrapper *cEventEmitter = cthis(eventEmitterWrapper);
InspectorData data = scheduler->getInspectorDataForInstance(
enableEventEmitterRawPointer_ ? *cEventEmitter->eventEmitterPointer
: *cEventEmitter->eventEmitter);
InspectorData data =
scheduler->getInspectorDataForInstance(*cEventEmitter->eventEmitter);

folly::dynamic result = folly::dynamic::object;
result["fileName"] = data.fileName;
Expand Down Expand Up @@ -369,9 +368,6 @@ void Binding::installFabricUIManager(
disableRevisionCheckForPreallocation_ =
config->getBool("react_fabric:disable_revision_check_for_preallocation");

enableEventEmitterRawPointer_ =
config->getBool("react_fabric:enable_event_emitter_wrapper_raw_pointer");

if (enableFabricLogs_) {
LOG(WARNING) << "Binding::installFabricUIManager() was called (address: "
<< this << ").";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ class Binding : public jni::HybridClass<Binding>,
bool disablePreallocateViews_{false};
bool enableFabricLogs_{false};
bool disableRevisionCheckForPreallocation_{false};
bool enableEventEmitterRawPointer_{false};
bool dispatchPreallocationInBackground_{false};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ void EventEmitterWrapper::invokeEvent(
std::string const &eventName,
NativeMap *payload,
int category) {
if (eventEmitterPointer) {
eventEmitterPointer->dispatchEvent(
eventName,
payload->consume(),
EventPriority::AsynchronousBatched,
static_cast<RawEvent::Category>(category));
return;
}

// It is marginal, but possible for this to be constructed without a valid
// EventEmitter. In those cases, make sure we noop/blackhole events instead of
// crashing.
Expand All @@ -47,10 +38,6 @@ void EventEmitterWrapper::invokeUniqueEvent(
std::string const &eventName,
NativeMap *payload,
int customCoalesceKey) {
if (eventEmitterPointer) {
eventEmitterPointer->dispatchUniqueEvent(eventName, payload->consume());
return;
}
// TODO: customCoalesceKey currently unused
// It is marginal, but possible for this to be constructed without a valid
// EventEmitter. In those cases, make sure we noop/blackhole events instead of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class EventEmitterWrapper : public jni::HybridClass<EventEmitterWrapper> {
static void registerNatives();

SharedEventEmitter eventEmitter;
EventEmitter const *eventEmitterPointer;

void
invokeEvent(std::string const &eventName, NativeMap *params, int category);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,7 @@ void FabricMountingManager::executeMount(
mountItem.newChildShadowView.eventEmitter;
auto javaEventEmitter = EventEmitterWrapper::newObjectJavaArgs();
EventEmitterWrapper *cEventEmitter = cthis(javaEventEmitter);
if (enableEventEmitterRawPointer_) {
cEventEmitter->eventEmitterPointer = eventEmitter.get();
} else {
cEventEmitter->eventEmitter = eventEmitter;
}
cEventEmitter->eventEmitter = eventEmitter;
temp[0] = mountItem.newChildShadowView.tag;
temp[1] = isLayoutable;
env->SetIntArrayRegion(intBufferArray, intBufferPosition, 2, temp);
Expand Down Expand Up @@ -729,11 +725,7 @@ void FabricMountingManager::executeMount(
// Do not hold a reference to javaEventEmitter from the C++ side.
auto javaEventEmitter = EventEmitterWrapper::newObjectJavaArgs();
EventEmitterWrapper *cEventEmitter = cthis(javaEventEmitter);
if (enableEventEmitterRawPointer_) {
cEventEmitter->eventEmitterPointer = eventEmitter.get();
} else {
cEventEmitter->eventEmitter = eventEmitter;
}
cEventEmitter->eventEmitter = eventEmitter;

(*objBufferArray)[objBufferPosition++] = javaEventEmitter.get();
}
Expand Down Expand Up @@ -830,11 +822,7 @@ void FabricMountingManager::preallocateShadowView(
if (eventEmitter != nullptr) {
javaEventEmitter = EventEmitterWrapper::newObjectJavaArgs();
EventEmitterWrapper *cEventEmitter = cthis(javaEventEmitter);
if (enableEventEmitterRawPointer_) {
cEventEmitter->eventEmitterPointer = eventEmitter.get();
} else {
cEventEmitter->eventEmitter = eventEmitter;
}
cEventEmitter->eventEmitter = eventEmitter;
}
}

Expand Down Expand Up @@ -947,8 +935,6 @@ FabricMountingManager::FabricMountingManager(
: javaUIManager_(javaUIManager) {
enableEarlyEventEmitterUpdate_ =
config->getBool("react_fabric:enable_early_event_emitter_update");
enableEventEmitterRawPointer_ =
config->getBool("react_fabric:enable_event_emitter_wrapper_raw_pointer");
disablePreallocateViews_ =
config->getBool("react_fabric:disabled_view_preallocation_android");
disableRevisionCheckForPreallocation_ =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class FabricMountingManager {
butter::map<SurfaceId, butter::set<Tag>> allocatedViewRegistry_{};
std::recursive_mutex allocatedViewsMutex_;

bool enableEventEmitterRawPointer_{false};
bool enableEarlyEventEmitterUpdate_{false};
bool disablePreallocateViews_{false};
bool disableRevisionCheckForPreallocation_{false};
Expand Down

0 comments on commit 4cbcb7a

Please sign in to comment.