Remove FabricBinder interface

Summary: This diff removes the FabricBinder interface as it is not required anymore

Reviewed By: sahrens

Differential Revision: D13707495

fbshipit-source-id: ba470e7b0884d75491b1b162cd6bce09c193d863
This commit is contained in:
David Vacca 2019-01-17 12:27:56 -08:00 committed by Facebook Github Bot
parent b2459cc01c
commit 4802cffa14
5 changed files with 9 additions and 24 deletions

View File

@ -1,14 +0,0 @@
/**
* 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.
*/
package com.facebook.react.fabric;
public interface FabricBinder<T extends FabricBinding> {
void setBinding(T binding);
}

View File

@ -16,7 +16,7 @@ public interface FabricBinding {
// TODO: T31905686 change types of UIManager and EventBeatManager when moving to OSS // TODO: T31905686 change types of UIManager and EventBeatManager when moving to OSS
void register( void register(
JavaScriptContextHolder jsContext, JavaScriptContextHolder jsContext,
FabricBinder fabricBinder, FabricUIManager fabricUIManager,
EventBeatManager eventBeatManager, EventBeatManager eventBeatManager,
MessageQueueThread jsMessageQueueThread, MessageQueueThread jsMessageQueueThread,
ComponentFactoryDelegate componentFactoryDelegate); ComponentFactoryDelegate componentFactoryDelegate);

View File

@ -36,7 +36,7 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
public UIManager get() { public UIManager get() {
final EventBeatManager eventBeatManager = final EventBeatManager eventBeatManager =
new EventBeatManager(mJSContext, mReactApplicationContext); new EventBeatManager(mJSContext, mReactApplicationContext);
final UIManager uiManager = createUIManager(eventBeatManager); final FabricUIManager uiManager = createUIManager(eventBeatManager);
Systrace.beginSection( Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.registerBinding"); Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.registerBinding");
final FabricBinding binding = new Binding(); final FabricBinding binding = new Binding();
@ -45,13 +45,13 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
.getCatalystInstance() .getCatalystInstance()
.getReactQueueConfiguration() .getReactQueueConfiguration()
.getJSQueueThread(); .getJSQueueThread();
binding.register(mJSContext, (FabricBinder) uiManager, eventBeatManager, jsMessageQueueThread, binding.register(mJSContext, uiManager, eventBeatManager, jsMessageQueueThread,
mComponentFactoryDelegate); mComponentFactoryDelegate);
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
return uiManager; return uiManager;
} }
private UIManager createUIManager(EventBeatManager eventBeatManager) { private FabricUIManager createUIManager(EventBeatManager eventBeatManager) {
Systrace.beginSection( Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.createUIManager"); Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.createUIManager");
UIManagerModule nativeModule = mReactApplicationContext.getNativeModule(UIManagerModule.class); UIManagerModule nativeModule = mReactApplicationContext.getNativeModule(UIManagerModule.class);

View File

@ -64,7 +64,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@SuppressLint("MissingNativeLoadLibrary") @SuppressLint("MissingNativeLoadLibrary")
public class FabricUIManager implements UIManager, FabricBinder<Binding>, LifecycleEventListener { public class FabricUIManager implements UIManager, LifecycleEventListener {
private static final String TAG = FabricUIManager.class.getSimpleName(); private static final String TAG = FabricUIManager.class.getSimpleName();
@ -310,7 +310,6 @@ public class FabricUIManager implements UIManager, FabricBinder<Binding>, Lifecy
} }
} }
@Override
public void setBinding(Binding binding) { public void setBinding(Binding binding) {
mBinding = binding; mBinding = binding;
} }

View File

@ -12,8 +12,8 @@ import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.JavaScriptContextHolder; import com.facebook.react.bridge.JavaScriptContextHolder;
import com.facebook.react.bridge.NativeMap; import com.facebook.react.bridge.NativeMap;
import com.facebook.react.bridge.queue.MessageQueueThread; import com.facebook.react.bridge.queue.MessageQueueThread;
import com.facebook.react.fabric.FabricBinder;
import com.facebook.react.fabric.FabricBinding; import com.facebook.react.fabric.FabricBinding;
import com.facebook.react.fabric.FabricUIManager;
import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.PixelUtil;
@DoNotStrip @DoNotStrip
@ -53,13 +53,13 @@ public class Binding implements FabricBinding {
@Override @Override
public void register( public void register(
JavaScriptContextHolder jsContext, JavaScriptContextHolder jsContext,
FabricBinder fabricModule, FabricUIManager fabricUIManager,
EventBeatManager eventBeatManager, EventBeatManager eventBeatManager,
MessageQueueThread jsMessageQueueThread, MessageQueueThread jsMessageQueueThread,
ComponentFactoryDelegate componentFactoryDelegate) { ComponentFactoryDelegate componentFactoryDelegate) {
fabricModule.setBinding(this); fabricUIManager.setBinding(this);
installFabricUIManager( installFabricUIManager(
jsContext.get(), fabricModule, eventBeatManager, jsMessageQueueThread, componentFactoryDelegate); jsContext.get(), fabricUIManager, eventBeatManager, jsMessageQueueThread, componentFactoryDelegate);
setPixelDensity(PixelUtil.getDisplayMetricDensity()); setPixelDensity(PixelUtil.getDisplayMetricDensity());
} }