ReactMarker.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #ifdef __APPLE__
  9. #include <functional>
  10. #endif
  11. namespace facebook {
  12. namespace react {
  13. namespace ReactMarker {
  14. enum ReactMarkerId {
  15. NATIVE_REQUIRE_START,
  16. NATIVE_REQUIRE_STOP,
  17. RUN_JS_BUNDLE_START,
  18. RUN_JS_BUNDLE_STOP,
  19. CREATE_REACT_CONTEXT_STOP,
  20. JS_BUNDLE_STRING_CONVERT_START,
  21. JS_BUNDLE_STRING_CONVERT_STOP,
  22. NATIVE_MODULE_SETUP_START,
  23. NATIVE_MODULE_SETUP_STOP,
  24. REGISTER_JS_SEGMENT_START,
  25. REGISTER_JS_SEGMENT_STOP
  26. };
  27. #ifdef __APPLE__
  28. using LogTaggedMarker =
  29. std::function<void(const ReactMarkerId, const char *tag)>;
  30. #else
  31. typedef void (*LogTaggedMarker)(const ReactMarkerId, const char *tag);
  32. #endif
  33. #ifndef RN_EXPORT
  34. #define RN_EXPORT __attribute__((visibility("default")))
  35. #endif
  36. extern RN_EXPORT LogTaggedMarker logTaggedMarker;
  37. extern RN_EXPORT void logMarker(const ReactMarkerId markerId);
  38. } // namespace ReactMarker
  39. } // namespace react
  40. } // namespace facebook