mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 09:29:07 +08:00
move page registration logic in to jsinspector
Reviewed By: pakoito Differential Revision: D6531199 fbshipit-source-id: ed1ae9e2f0c19e7656cd022e438693798320e55a
This commit is contained in:
committed by
Facebook Github Bot
parent
48019a0c2a
commit
bef7967f9a
@@ -215,11 +215,12 @@ namespace facebook {
|
||||
const std::string ownerId = m_jscConfig.getDefault("OwnerIdentity", "unknown").getString();
|
||||
const std::string appId = m_jscConfig.getDefault("AppIdentity", "unknown").getString();
|
||||
const std::string deviceId = m_jscConfig.getDefault("DeviceIdentity", "unknown").getString();
|
||||
const std::function<bool()> checkIsInspectedRemote = [&](){
|
||||
auto checkIsInspectedRemote = [ownerId, appId, deviceId]() {
|
||||
return isNetworkInspected(ownerId, appId, deviceId);
|
||||
};
|
||||
IInspector* pInspector = JSC_JSInspectorGetInstance(true);
|
||||
pInspector->registerGlobalContext(ownerId, checkIsInspectedRemote, m_context);
|
||||
|
||||
auto& globalInspector = facebook::react::getInspectorInstance();
|
||||
JSC_JSGlobalContextEnableDebugger(m_context, globalInspector, ownerId.c_str(), checkIsInspectedRemote);
|
||||
}
|
||||
|
||||
installNativeHook<&JSCExecutor::nativeFlushQueueImmediate>("nativeFlushQueueImmediate");
|
||||
@@ -340,8 +341,8 @@ namespace facebook {
|
||||
m_nativeModules.reset();
|
||||
|
||||
if (canUseInspector(context)) {
|
||||
IInspector* pInspector = JSC_JSInspectorGetInstance(true);
|
||||
pInspector->unregisterGlobalContext(context);
|
||||
auto &globalInspector = facebook::react::getInspectorInstance();
|
||||
JSC_JSGlobalContextDisableDebugger(context, globalInspector);
|
||||
}
|
||||
|
||||
JSC_JSGlobalContextRelease(context);
|
||||
|
||||
Reference in New Issue
Block a user