[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:
Tadeu Zagallo
2015-05-14 15:55:31 -07:00
parent 22fb03d7e0
commit e467fb7202
2 changed files with 54 additions and 0 deletions

View File

@@ -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();