From d33e84dde5510522caa6cbb2d7485172d61c07d3 Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Sat, 31 Oct 2015 16:41:27 -0700 Subject: [PATCH] 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 --- .../Initialization/InitializeJavaScriptAppEngine.js | 2 -- Libraries/Utilities/BridgeProfiling.js | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index 4060528c1..93e97e60b 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -159,8 +159,6 @@ function setUpWebSockets() { } function setUpProfile() { - console.profile = console.profile || GLOBAL.nativeTraceBeginSection || function () {}; - console.profileEnd = console.profileEnd || GLOBAL.nativeTraceEndSection || function () {}; if (__DEV__) { require('BridgeProfiling').swizzleReactPerf(); } diff --git a/Libraries/Utilities/BridgeProfiling.js b/Libraries/Utilities/BridgeProfiling.js index 8ff7583cd..c543eb7e2 100644 --- a/Libraries/Utilities/BridgeProfiling.js +++ b/Libraries/Utilities/BridgeProfiling.js @@ -34,13 +34,13 @@ var BridgeProfiling = { if (_enabled) { profileName = typeof profileName === 'function' ? profileName() : profileName; - console.profile(TRACE_TAG_REACT_APPS, profileName); + global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName); } }, profileEnd() { if (_enabled) { - console.profileEnd(TRACE_TAG_REACT_APPS); + global.nativeTraceEndSection(TRACE_TAG_REACT_APPS); } },