/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCommon/react/renderer/core/EventLogger.h
51 строка
1 KB
Ruslan Lesiutin
Replace DOMHighResTimeStamp alias in ReactCommon with new abstractions (#51512)
22 май 2025, 20:16
22 май 2025, 20:16
f03268b
Код
Авторство
О чём код?
/* * 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 <react/renderer/core/EventTarget.h> #include <react/timing/primitives.h> #include <optional> #include <string_view> namespace facebook::react { using EventTag = unsigned int; const EventTag EMPTY_EVENT_TAG = 0; /* * Interface for logging discrete events (such as pointerenter/leave), * which can be used for implementing W3C Event Timing API standard, * see https://www.w3.org/TR/event-timing */ class EventLogger { public: virtual ~EventLogger() = default; /* * Called when an event is first created, returns and unique tag for this * event, which can be used to log further event processing stages. */ virtual EventTag onEventStart( std::string_view name, SharedEventTarget target, std::optional<HighResTimeStamp> eventStartTimeStamp = std::nullopt) = 0; /* * Called when event starts getting dispatched (processed by the handlers, if * any) */ virtual void onEventProcessingStart(EventTag tag) = 0; /* * Called when event finishes being dispatched */ virtual void onEventProcessingEnd(EventTag tag) = 0; }; } // namespace facebook::react