Ben Nham 65f22a5190 log script name with bundle loading perf event
Reviewed By: javache

Differential Revision: D5010638

fbshipit-source-id: 2e139201a8374245fa1dedc4f11a716dcf700fd7
2017-05-10 04:09:19 -07:00

52 lines
1.1 KiB
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <functional>
#include <memory>
#include <string>
#include <cxxreact/Executor.h>
#include <cxxreact/MessageQueueThread.h>
#include <jschelpers/JavaScriptCore.h>
namespace facebook {
namespace react {
namespace ReactMarker {
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,
};
using LogTaggedMarker = std::function<void(const ReactMarkerId, const char* tag)>;
extern LogTaggedMarker logTaggedMarker;
extern void logMarker(const ReactMarkerId markerId);
};
namespace PerfLogging {
using InstallNativeHooks = std::function<void(JSGlobalContextRef)>;
extern InstallNativeHooks installNativeHooks;
};
namespace JSNativeHooks {
using Hook = JSValueRef (*) (
JSContextRef ctx,
JSObjectRef function,
JSObjectRef thisObject,
size_t argumentCount,
const JSValueRef arguments[],
JSValueRef *exception);
extern Hook loggingHook;
extern Hook nowHook;
}
} }