Skip to content

Commit

Permalink
flag
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmondChuiHW committed Mar 12, 2024
1 parent 16b80a5 commit 6fb80fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions front_end/core/host/RNPerfMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ class RNPerfMetricsImpl implements RNPerfMetrics {
}
}

export function registerGlobalPerfMetricsListener(): void {
if (globalThis.enableReactNativePerfMetrics !== true) {
export function registerPerfMetricsGlobalPostMessageHandler(): void {
if (globalThis.enableReactNativePerfMetrics !== true ||
globalThis.enableReactNativePerfMetricsGlobalPostMessage !== true) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion front_end/entrypoints/rn_inspector/rn_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as Host from '../../core/host/host.js';
import * as Root from '../../core/root/root.js';
import * as Main from '../main/main.js';

Host.RNPerfMetrics.registerGlobalPerfMetricsListener();
Host.RNPerfMetrics.registerPerfMetricsGlobalPostMessageHandler();

// Legacy JavaScript Profiler - we support this until Hermes can support the
// modern Performance panel.
Expand Down
1 change: 1 addition & 0 deletions front_end/global_typings/react_native.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export {};
declare global {
namespace globalThis {
var enableReactNativePerfMetrics: boolean|undefined;
var enableReactNativePerfMetricsGlobalPostMessage: boolean|undefined;
}
}

0 comments on commit 6fb80fe

Please sign in to comment.