2016-05-03 19:29:58 -07:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
2017-02-15 09:49:07 -08:00
|
|
|
#include <cxxreact/Executor.h>
|
|
|
|
#include <cxxreact/MessageQueueThread.h>
|
2016-11-22 06:05:36 -08:00
|
|
|
#include <jschelpers/JavaScriptCore.h>
|
2016-05-03 19:29:58 -07:00
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
|
|
|
namespace ReactMarker {
|
2017-06-07 10:17:58 -07:00
|
|
|
|
2017-04-25 02:29:29 -07: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 06:11:43 -07:00
|
|
|
NATIVE_MODULE_SETUP_START,
|
|
|
|
NATIVE_MODULE_SETUP_STOP,
|
2017-04-25 02:29:29 -07:00
|
|
|
};
|
2017-05-10 03:48:13 -07:00
|
|
|
|
|
|
|
using LogTaggedMarker = std::function<void(const ReactMarkerId, const char* tag)>;
|
|
|
|
extern LogTaggedMarker logTaggedMarker;
|
|
|
|
|
|
|
|
extern void logMarker(const ReactMarkerId markerId);
|
|
|
|
|
2017-06-07 10:17:58 -07:00
|
|
|
}
|
2016-05-03 19:29:58 -07:00
|
|
|
|
2017-06-07 10:17:58 -07: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-03 19:29:58 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} }
|