Skip to content

Commit d33e84d

Browse files
tadeuzagallofacebook-github-bot-5
authored andcommitted
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
1 parent 7ae39f8 commit d33e84d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ function setUpWebSockets() {
159159
}
160160

161161
function setUpProfile() {
162-
console.profile = console.profile || GLOBAL.nativeTraceBeginSection || function () {};
163-
console.profileEnd = console.profileEnd || GLOBAL.nativeTraceEndSection || function () {};
164162
if (__DEV__) {
165163
require('BridgeProfiling').swizzleReactPerf();
166164
}

Libraries/Utilities/BridgeProfiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ var BridgeProfiling = {
3434
if (_enabled) {
3535
profileName = typeof profileName === 'function' ?
3636
profileName() : profileName;
37-
console.profile(TRACE_TAG_REACT_APPS, profileName);
37+
global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName);
3838
}
3939
},
4040

4141
profileEnd() {
4242
if (_enabled) {
43-
console.profileEnd(TRACE_TAG_REACT_APPS);
43+
global.nativeTraceEndSection(TRACE_TAG_REACT_APPS);
4444
}
4545
},
4646

0 commit comments

Comments
 (0)