Kill JSCConfig

Reviewed By: mhorowitz

Differential Revision: D5662181

fbshipit-source-id: 71a4d6cf4eb34030d4f86e96e8bc6f8e8efe5fdd
This commit is contained in:
Michał Gregorczyk 2017-08-21 13:32:43 -07:00 committed by Facebook Github Bot
parent 67c160cc6c
commit 606a876df7
4 changed files with 6 additions and 37 deletions

View File

@ -1,19 +0,0 @@
// Copyright 2004-present Facebook. All Rights Reserved.
package com.facebook.react;
import com.facebook.react.bridge.WritableNativeMap;
/**
* Interface for the configuration object that is passed to JSC.
*/
public interface JSCConfig {
JSCConfig EMPTY = new JSCConfig() {
@Override
public WritableNativeMap getConfigMap() {
return new WritableNativeMap();
}
};
WritableNativeMap getConfigMap();
}

View File

@ -144,7 +144,6 @@ public class ReactInstanceManager {
private final UIImplementationProvider mUIImplementationProvider;
private final MemoryPressureRouter mMemoryPressureRouter;
private final @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;
private final JSCConfig mJSCConfig;
private final boolean mLazyNativeModulesEnabled;
private final boolean mLazyViewManagersEnabled;
private final boolean mUseSeparateUIBackgroundThread;
@ -217,7 +216,6 @@ public class ReactInstanceManager {
LifecycleState initialLifecycleState,
UIImplementationProvider uiImplementationProvider,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
JSCConfig jscConfig,
@Nullable RedBoxHandler redBoxHandler,
boolean lazyNativeModulesEnabled,
boolean lazyViewManagersEnabled,
@ -253,7 +251,6 @@ public class ReactInstanceManager {
mUIImplementationProvider = uiImplementationProvider;
mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
mJSCConfig = jscConfig;
mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
mLazyViewManagersEnabled = lazyViewManagersEnabled;
mMinTimeLeftInFrameForNonBatchedOperationMs = minTimeLeftInFrameForNonBatchedOperationMs;
@ -447,9 +444,7 @@ public class ReactInstanceManager {
Log.d(
ReactConstants.TAG,
"ReactInstanceManager.recreateReactContextInBackgroundFromBundleLoader()");
recreateReactContextInBackground(
new JSCJavaScriptExecutor.Factory(mJSCConfig.getConfigMap()),
mBundleLoader);
recreateReactContextInBackground(new JSCJavaScriptExecutor.Factory(), mBundleLoader);
}
/**
@ -795,10 +790,9 @@ public class ReactInstanceManager {
private void onJSBundleLoadedFromServer() {
Log.d(ReactConstants.TAG, "ReactInstanceManager.onJSBundleLoadedFromServer()");
recreateReactContextInBackground(
new JSCJavaScriptExecutor.Factory(mJSCConfig.getConfigMap()),
new JSCJavaScriptExecutor.Factory(),
JSBundleLoader.createCachedBundleFromNetworkLoader(
mDevSupportManager.getSourceUrl(),
mDevSupportManager.getDownloadedJSBundleFile()));
mDevSupportManager.getSourceUrl(), mDevSupportManager.getDownloadedJSBundleFile()));
}
@ThreadConfined(UI)

View File

@ -34,7 +34,6 @@ public class ReactInstanceManagerBuilder {
private @Nullable LifecycleState mInitialLifecycleState;
private @Nullable UIImplementationProvider mUIImplementationProvider;
private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;
private JSCConfig mJSCConfig = JSCConfig.EMPTY;
private @Nullable Activity mCurrentActivity;
private @Nullable DefaultHardwareBackBtnHandler mDefaultHardwareBackBtnHandler;
private @Nullable RedBoxHandler mRedBoxHandler;
@ -170,11 +169,6 @@ public class ReactInstanceManagerBuilder {
return this;
}
public ReactInstanceManagerBuilder setJSCConfig(JSCConfig jscConfig) {
mJSCConfig = jscConfig;
return this;
}
public ReactInstanceManagerBuilder setRedBoxHandler(@Nullable RedBoxHandler redBoxHandler) {
mRedBoxHandler = redBoxHandler;
return this;
@ -266,7 +260,6 @@ public class ReactInstanceManagerBuilder {
Assertions.assertNotNull(mInitialLifecycleState, "Initial lifecycle state was not set"),
mUIImplementationProvider,
mNativeModuleCallExceptionHandler,
mJSCConfig,
mRedBoxHandler,
mLazyNativeModulesEnabled,
mLazyViewManagersEnabled,

View File

@ -17,7 +17,8 @@ public class JSCJavaScriptExecutor extends JavaScriptExecutor {
public static class Factory implements JavaScriptExecutor.Factory {
private ReadableNativeMap mJSCConfig;
public Factory(WritableNativeMap jscConfig) {
public Factory() {
WritableNativeMap jscConfig = new WritableNativeMap();
jscConfig.putString("OwnerIdentity", "ReactNative");
mJSCConfig = jscConfig;
}
@ -32,7 +33,7 @@ public class JSCJavaScriptExecutor extends JavaScriptExecutor {
ReactBridge.staticInit();
}
public JSCJavaScriptExecutor(ReadableNativeMap jscConfig) {
private JSCJavaScriptExecutor(ReadableNativeMap jscConfig) {
super(initHybrid(jscConfig));
}