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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
using LogTaggedMarker = std::function<void(const ReactMarkerId, const char* tag)>;
|
|
|
|
extern LogTaggedMarker logTaggedMarker;
|
|
|
|
|
|
|
|
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);
|
|
|
|
extern Hook loggingHook;
|
|
|
|
extern Hook nowHook;
|
|
|
|
|
|
|
|
using ConfigurationHook = std::function<void(JSGlobalContextRef)>;
|
|
|
|
extern ConfigurationHook installPerfHooks;
|
2016-05-04 02:29:58 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} }
|