2016-05-04 02:29:58 +00:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
2017-06-23 23:49:55 +00:00
|
|
|
#include <cxxreact/JSExecutor.h>
|
2017-02-15 17:49:07 +00:00
|
|
|
#include <cxxreact/MessageQueueThread.h>
|
2016-11-22 14:05:36 +00:00
|
|
|
#include <jschelpers/JavaScriptCore.h>
|
2016-05-04 02:29:58 +00:00
|
|
|
|
2017-06-27 18:15:36 +00:00
|
|
|
#ifndef RN_EXPORT
|
|
|
|
#define RN_EXPORT __attribute__((visibility("default")))
|
|
|
|
#endif
|
|
|
|
|
2016-05-04 02:29:58 +00:00
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
|
|
|
namespace ReactMarker {
|
2017-06-07 17:17:58 +00:00
|
|
|
|
2017-04-25 09:29:29 +00:00
|
|
|
enum ReactMarkerId {
|
|
|
|
NATIVE_REQUIRE_START,
|
|
|
|
NATIVE_REQUIRE_STOP,
|
|
|
|
RUN_JS_BUNDLE_START,
|
|
|
|
RUN_JS_BUNDLE_STOP,
|
|
|
|
CREATE_REACT_CONTEXT_STOP,
|
|
|
|
JS_BUNDLE_STRING_CONVERT_START,
|
|
|
|
JS_BUNDLE_STRING_CONVERT_STOP,
|
2017-06-09 13:11:43 +00:00
|
|
|
NATIVE_MODULE_SETUP_START,
|
|
|
|
NATIVE_MODULE_SETUP_STOP,
|
2017-04-25 09:29:29 +00:00
|
|
|
};
|
2017-05-10 10:48:13 +00:00
|
|
|
|
2017-12-14 22:32:31 +00:00
|
|
|
#ifdef __APPLE__
|
2017-05-10 10:48:13 +00:00
|
|
|
using LogTaggedMarker = std::function<void(const ReactMarkerId, const char* tag)>;
|
2017-12-14 22:32:31 +00:00
|
|
|
#else
|
|
|
|
typedef void(*LogTaggedMarker)(const ReactMarkerId, const char* tag);
|
|
|
|
#endif
|
2017-06-27 18:15:36 +00:00
|
|
|
extern RN_EXPORT LogTaggedMarker logTaggedMarker;
|
2017-05-10 10:48:13 +00:00
|
|
|
|
|
|
|
extern void logMarker(const ReactMarkerId markerId);
|
|
|
|
|
2017-06-07 17:17:58 +00:00
|
|
|
}
|
2016-05-04 02:29:58 +00:00
|
|
|
|
2017-06-07 17:17:58 +00:00
|
|
|
namespace JSCNativeHooks {
|
|
|
|
|
|
|
|
using Hook = JSValueRef(*)(
|
|
|
|
JSContextRef ctx,
|
|
|
|
JSObjectRef function,
|
|
|
|
JSObjectRef thisObject,
|
|
|
|
size_t argumentCount,
|
|
|
|
const JSValueRef arguments[],
|
|
|
|
JSValueRef *exception);
|
2017-06-27 18:15:36 +00:00
|
|
|
extern RN_EXPORT Hook loggingHook;
|
|
|
|
extern RN_EXPORT Hook nowHook;
|
2017-06-07 17:17:58 +00:00
|
|
|
|
2017-12-14 22:32:31 +00:00
|
|
|
typedef void(*ConfigurationHook)(JSGlobalContextRef);
|
2017-06-27 18:15:36 +00:00
|
|
|
extern RN_EXPORT ConfigurationHook installPerfHooks;
|
2016-05-04 02:29:58 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} }
|