mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Use nativeTrace(Begin|End)Section directly from BridgeProfiling
Summary: public Call the native bindings explicitly from BridgeProfiling instead of polyfill'ing `console.profile` with a function that has a different signature. Reviewed By: vjeux Differential Revision: D2602313 fb-gh-sync-id: 9295eff9458f2caa35b7e982c0f7c06dbe65fd09
This commit is contained in:
committed by
facebook-github-bot-5
parent
7ae39f83ac
commit
d33e84dde5
@@ -159,8 +159,6 @@ function setUpWebSockets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setUpProfile() {
|
function setUpProfile() {
|
||||||
console.profile = console.profile || GLOBAL.nativeTraceBeginSection || function () {};
|
|
||||||
console.profileEnd = console.profileEnd || GLOBAL.nativeTraceEndSection || function () {};
|
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
require('BridgeProfiling').swizzleReactPerf();
|
require('BridgeProfiling').swizzleReactPerf();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ var BridgeProfiling = {
|
|||||||
if (_enabled) {
|
if (_enabled) {
|
||||||
profileName = typeof profileName === 'function' ?
|
profileName = typeof profileName === 'function' ?
|
||||||
profileName() : profileName;
|
profileName() : profileName;
|
||||||
console.profile(TRACE_TAG_REACT_APPS, profileName);
|
global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
profileEnd() {
|
profileEnd() {
|
||||||
if (_enabled) {
|
if (_enabled) {
|
||||||
console.profileEnd(TRACE_TAG_REACT_APPS);
|
global.nativeTraceEndSection(TRACE_TAG_REACT_APPS);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user