mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-12 17:30:12 +08:00
Enable javascript systrace markers via js module
Differential Revision: D2658662 fb-gh-sync-id: 042377551f9dacc0a9d12728edfa54a57c617cf4
This commit is contained in:
committed by
facebook-github-bot-7
parent
2f9e7be04b
commit
619da521f3
@@ -66,7 +66,7 @@ public class CatalystInstance {
|
||||
private @Nullable ReactBridge mBridge;
|
||||
private boolean mJSBundleHasLoaded;
|
||||
|
||||
private CatalystInstance(
|
||||
private CatalystInstance(
|
||||
final CatalystQueueConfigurationSpec catalystQueueConfigurationSpec,
|
||||
final JavaScriptExecutor jsExecutor,
|
||||
final NativeModuleRegistry registry,
|
||||
@@ -412,38 +412,12 @@ public class CatalystInstance {
|
||||
private class JSProfilerTraceListener implements TraceListener {
|
||||
@Override
|
||||
public void onTraceStarted() {
|
||||
mCatalystQueueConfiguration.getJSQueueThread().runOnQueue(
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread();
|
||||
|
||||
if (mDestroyed) {
|
||||
return;
|
||||
}
|
||||
Assertions.assertNotNull(mBridge).setGlobalVariable(
|
||||
"__BridgeProfilingIsProfiling",
|
||||
"true");
|
||||
}
|
||||
});
|
||||
getJSModule(BridgeProfiling.class).setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTraceStopped() {
|
||||
mCatalystQueueConfiguration.getJSQueueThread().runOnQueue(
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread();
|
||||
|
||||
if (mDestroyed) {
|
||||
return;
|
||||
}
|
||||
Assertions.assertNotNull(mBridge).setGlobalVariable(
|
||||
"__BridgeProfilingIsProfiling",
|
||||
"false");
|
||||
}
|
||||
});
|
||||
getJSModule(BridgeProfiling.class).setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user