mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-07 13:05:18 +08:00
Adding support in the new RN bridge on iOS
Differential Revision: D4393955 fbshipit-source-id: e5f3fb6773908678773a5dd4fdea568bcc200336
This commit is contained in:
committed by
Facebook Github Bot
parent
7c2f8a9e14
commit
b50f55026a
@@ -1,15 +1,16 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#ifdef WITH_JSC_EXTRA_TRACING
|
||||
|
||||
#include "JSCSamplingProfiler.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <JavaScriptCore/API/JSProfilerPrivate.h>
|
||||
#include <jschelpers/JSCHelpers.h>
|
||||
#include <jschelpers/Value.h>
|
||||
|
||||
#ifndef __APPLE__
|
||||
#include <JavaScriptCore/API/JSProfilerPrivate.h>
|
||||
#endif
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
namespace {
|
||||
@@ -26,10 +27,11 @@ static JSValueRef pokeSamplingProfiler(
|
||||
|
||||
void initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx) {
|
||||
JSC_JSStartSamplingProfilingOnMainJSCThread(ctx);
|
||||
|
||||
// Allow the profiler to be poked from JS as well
|
||||
// (see SamplingProfiler.js for an example of how it could be used with the JSCSamplingProfiler module).
|
||||
installGlobalFunction(ctx, "pokeSamplingProfiler", pokeSamplingProfiler);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WITH_JSC_EXTRA_TRACING
|
||||
|
||||
Reference in New Issue
Block a user