mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Scaffolding for the PerformanceObserver TurboModule (C++ side) (#35226)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/35226 Changelog: [Internal] This adds scaffolding for the C++ side of NativePerformanceObserver module. Thanks to christophpurrer for helping set this up, as this is the first one of this kind inside core/OSS. Reviewed By: rubennorte Differential Revision: D41028555 fbshipit-source-id: 4acf0e71a254a42044cbbe5f94f40938342c6aa2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ea1d72921d
commit
ea73a66936
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "NativePerformanceObserver.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
NativePerformanceObserver::NativePerformanceObserver(
|
||||
std::shared_ptr<CallInvoker> jsInvoker)
|
||||
: NativePerformanceObserverCxxSpec(std::move(jsInvoker)) {}
|
||||
|
||||
void NativePerformanceObserver::startReporting(
|
||||
jsi::Runtime &rt,
|
||||
std::string entryType) {
|
||||
LOG(INFO) << "Started reporting perf entry type: " << entryType;
|
||||
}
|
||||
|
||||
void NativePerformanceObserver::stopReporting(
|
||||
jsi::Runtime &rt,
|
||||
std::string entryType) {
|
||||
LOG(INFO) << "Stopped reporting perf entry type: " << entryType;
|
||||
}
|
||||
|
||||
std::vector<RawPerformanceEntry> NativePerformanceObserver::getPendingEntries(
|
||||
jsi::Runtime &rt) {
|
||||
return std::vector<RawPerformanceEntry>{};
|
||||
}
|
||||
|
||||
void NativePerformanceObserver::setOnPerformanceEntryCallback(
|
||||
jsi::Runtime &rt,
|
||||
std::optional<AsyncCallback<>> callback) {
|
||||
callback_ = callback;
|
||||
LOG(INFO) << "setOnPerformanceEntryCallback: "
|
||||
<< (callback ? "non-empty" : "empty");
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
Reference in New Issue
Block a user