File tree Expand file tree Collapse file tree
packages/react-native/ReactCommon
nativemodule/webperformance Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ std::string JSExecutor::getSyntheticBundlePath(
2727 return buffer.data ();
2828}
2929
30+ HighResTimeStamp JSExecutor::performanceNow () {
31+ return HighResTimeStamp::now ();
32+ }
33+
3034jsinspector_modern::RuntimeTargetDelegate&
3135JSExecutor::getRuntimeTargetDelegate () {
3236 if (!runtimeTargetDelegate_) {
Original file line number Diff line number Diff line change @@ -139,6 +139,8 @@ class RN_EXPORT JSExecutor {
139139 uint32_t bundleId,
140140 const std::string& bundlePath);
141141
142+ static HighResTimeStamp performanceNow ();
143+
142144 /* *
143145 * Get a reference to the \c RuntimeTargetDelegate owned (or implemented) by
144146 * this executor. This reference must remain valid for the duration of the
Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ void bindNativePerformanceNow(Runtime& runtime) {
557557 const jsi::Value&,
558558 const jsi::Value* args,
559559 size_t /* count*/ ) {
560- return HighResTimeStamp::now ().toDOMHighResTimeStamp ();
560+ return JSExecutor::performanceNow ().toDOMHighResTimeStamp ();
561561 }));
562562}
563563
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ NativePerformance::NativePerformance(std::shared_ptr<CallInvoker> jsInvoker)
117117 : NativePerformanceCxxSpec(std::move(jsInvoker)) {}
118118
119119HighResTimeStamp NativePerformance::now (jsi::Runtime& /* rt*/ ) {
120- return HighResTimeStamp::now ();
120+ return JSExecutor::performanceNow ();
121121}
122122
123123HighResTimeStamp NativePerformance::markWithResult (
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ void IntersectionObserverManager::observe(
9898
9999 if (!hasPendingTransactions) {
100100 auto entry = observer->updateIntersectionObservation (
101- *rootShadowNode, HighResTimeStamp::now ());
101+ *rootShadowNode, JSExecutor::performanceNow ());
102102 if (entry) {
103103 {
104104 std::unique_lock lock (pendingEntriesMutex_);
@@ -266,7 +266,7 @@ void IntersectionObserverManager::updateIntersectionObservations(
266266 }
267267
268268 auto entry = observer->updateIntersectionObservation (
269- *rootShadowNode, HighResTimeStamp::now ());
269+ *rootShadowNode, JSExecutor::performanceNow ());
270270 if (entry) {
271271 {
272272 std::unique_lock lock (pendingEntriesMutex_);
Original file line number Diff line number Diff line change @@ -638,7 +638,7 @@ void UIManager::shadowTreeDidFinishTransaction(
638638void UIManager::reportMount (SurfaceId surfaceId) const {
639639 TraceSection s (" UIManager::reportMount" );
640640
641- auto time = HighResTimeStamp::now ();
641+ auto time = JSExecutor::performanceNow ();
642642
643643 auto rootShadowNode = RootShadowNode::Shared{};
644644 shadowTreeRegistry_.visit (surfaceId, [&](const ShadowTree& shadowTree) {
You can’t perform that action at this time.
0 commit comments