/* * 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. */ #pragma once #include #include #include #include #include #include #include "NativePerformanceObserver_RawPerformanceEntry.h" namespace facebook::react { class NativePerformanceObserver : public NativePerformanceObserverCxxSpec, std::enable_shared_from_this { public: NativePerformanceObserver(std::shared_ptr jsInvoker); void startReporting(jsi::Runtime &rt, std::string entryType); void stopReporting(jsi::Runtime &rt, std::string entryType); std::vector getPendingEntries(jsi::Runtime &rt); void setOnPerformanceEntryCallback( jsi::Runtime &rt, std::optional> callback); private: std::optional> callback_; }; } // namespace facebook::react