Skip to content

Commit

Permalink
Fix for potential breakage due to incompatibility between binary and …
Browse files Browse the repository at this point in the history
…JS code in NativePerformanceObserver (#36841)

Summary:
Pull Request resolved: #36841

## Changelog:
[Internal] -

A follow-up to D44712550, which did not take into account that there may be incompatibility between app's binary and JS code.

Note that this is for VR apps only, as other platforms don't (yet) use the module in question (WebPerformance).

Reviewed By: javache

Differential Revision: D44751928

fbshipit-source-id: 6a029f5725dd45abded7dda3325debe864f29ca0
  • Loading branch information
rshest authored and facebook-github-bot committed Apr 6, 2023
1 parent 3506c8d commit 6bcf904
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react-native/Libraries/WebPerformance/Performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ const getCurrentTimeStamp: () => HighResTimeStamp = global.nativePerformanceNow
// even if they are not currently observed - this is either to be able to
// retrieve them at any time via Performance.getEntries* or to refer by other entries
// (such as when measures may refer to marks, even if the latter are not observed)
NativePerformanceObserver?.setIsBuffered(
ALWAYS_LOGGED_ENTRY_TYPES.map(performanceEntryTypeToRaw),
true,
);
if (NativePerformanceObserver?.setIsBuffered) {
NativePerformanceObserver?.setIsBuffered(
ALWAYS_LOGGED_ENTRY_TYPES.map(performanceEntryTypeToRaw),
true,
);
}

export class PerformanceMark extends PerformanceEntry {
detail: DetailType;
Expand Down

0 comments on commit 6bcf904

Please sign in to comment.