mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-30 22:48:23 +08:00
[ReactNative] Add console.profile hooks to systrace
Summary: Add console.profile sync hooks compliant with the chrome API https://developer.chrome.com/devtools/docs/console-api#consoleprofilelabel @public Test Plan: Add a `console.profile()` and a `console.profileEnd()` in the JavaScript, and record a systrace-like profile via DevMenu
This commit is contained in:
@@ -119,6 +119,11 @@ function setUpWebSockets() {
|
||||
GLOBAL.WebSocket = require('WebSocket');
|
||||
}
|
||||
|
||||
function setupProfile() {
|
||||
console.profile = console.profile || GLOBAL.consoleProfile || function () {};
|
||||
console.profileEnd = console.profileEnd || GLOBAL.consoleProfileEnd || function () {};
|
||||
}
|
||||
|
||||
setUpRedBoxErrorHandler();
|
||||
setUpTimers();
|
||||
setUpAlert();
|
||||
@@ -127,3 +132,4 @@ setUpXHR();
|
||||
setUpRedBoxConsoleErrorHandler();
|
||||
setUpGeolocation();
|
||||
setUpWebSockets();
|
||||
setupProfile();
|
||||
|
||||
Reference in New Issue
Block a user