Allow bridge delegate to specify whether to use custom JSC wrapper

Reviewed By: mhorowitz

Differential Revision: D4197657

fbshipit-source-id: 09e050f802b41c9a7016456c25381018b2123553
This commit is contained in:
Pieter De Baets 2016-11-23 03:57:58 -08:00 committed by Facebook Github Bot
parent 55a615bf98
commit cb3e575deb
2 changed files with 17 additions and 0 deletions

View File

@ -82,6 +82,15 @@
*/
- (BOOL)shouldBridgeInitializeNativeModulesSynchronously:(RCTBridge *)bridge;
/**
* Configure whether the JSCExecutor created should use the system JSC API or
* alternative hooks provided. When returning YES from this method, you must have
* previously called facebook::react::setCustomJSCWrapper.
*
* @experimental
*/
- (BOOL)shouldBridgeUseCustomJSC:(RCTBridge *)bridge;
/**
* The bridge will automatically attempt to load the JS source code from the
* location specified by the `sourceURLForBridge:` method, however, if you want

View File

@ -216,7 +216,15 @@ void JSCExecutor::setContextName(const std::string& name) {
void JSCExecutor::initOnJSVMThread() throw(JSException) {
SystraceSection s("JSCExecutor.initOnJSVMThread");
#if defined(__APPLE__)
const bool useCustomJSC = m_jscConfig.getDefault("UseCustomJSC", false).getBool();
if (useCustomJSC) {
JSC_configureJSCForIOS(true);
}
#else
const bool useCustomJSC = false;
#endif
#if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__)
configureJSCForAndroid(m_jscConfig);
#endif