Put 'trace' on the chrome://inspect page by default.
Using a hidden query parameter to do this is a pain. I can never remember if it's trace, tracing, #trace, #tracing, etc. :| bmeurer@ says patches welcome on Twitter, so let's test that :) https://twitter.com/bmeurer/status/1189053658983522305 TEST='trace' links appear by default on chrome://inspect. Change-Id: Id56f97b913652664e0bd7f88ba2b95183fa2b5e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1896237 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#712282}
This commit is contained in:
@ -10,8 +10,8 @@ const WEBRTC_SERIAL = 'WEBRTC';
|
||||
let HOST_CHROME_VERSION;
|
||||
|
||||
const queryParamsObject = {};
|
||||
let browserInspector;
|
||||
let browserInspectorTitle;
|
||||
let browserInspector = 'chrome://tracing';
|
||||
let browserInspectorTitle = 'trace';
|
||||
|
||||
(function() {
|
||||
const chromeMatch = navigator.userAgent.match(/(?:^|\W)Chrome\/(\S+)/);
|
||||
@ -29,10 +29,7 @@ for (let i = 0; i < params.length; ++i) {
|
||||
queryParamsObject[pair[0]] = pair[1];
|
||||
}
|
||||
|
||||
if ('trace' in queryParamsObject || 'tracing' in queryParamsObject) {
|
||||
browserInspector = 'chrome://tracing';
|
||||
browserInspectorTitle = 'trace';
|
||||
} else {
|
||||
if ('browser-inspector' in queryParamsObject) {
|
||||
browserInspector = queryParamsObject['browser-inspector'];
|
||||
browserInspectorTitle = 'inspect';
|
||||
}
|
||||
@ -197,8 +194,7 @@ function alreadyDisplayed(element, data) {
|
||||
function updateBrowserVisibility(browserSection) {
|
||||
const icon = browserSection.querySelector('.used-for-port-forwarding');
|
||||
browserSection.hidden = !browserSection.querySelector('.open') &&
|
||||
!browserSection.querySelector('.row') && !browserInspector &&
|
||||
(!icon || icon.hidden);
|
||||
!browserSection.querySelector('.row') && (!icon || icon.hidden);
|
||||
}
|
||||
|
||||
function updateUsernameVisibility(deviceSection) {
|
||||
@ -410,19 +406,17 @@ function populateRemoteTargets(devices) {
|
||||
'forwarding. Closing it will drop current connections.';
|
||||
browserHeader.appendChild(portForwardingInfo);
|
||||
|
||||
if (browserInspector) {
|
||||
const link = document.createElement('span');
|
||||
link.classList.add('action');
|
||||
link.setAttribute('tabindex', 1);
|
||||
link.textContent = browserInspectorTitle;
|
||||
browserHeader.appendChild(link);
|
||||
link.addEventListener(
|
||||
'click',
|
||||
sendCommand.bind(
|
||||
null, 'inspect-browser', browser.source, browser.id,
|
||||
browserInspector),
|
||||
false);
|
||||
}
|
||||
const link = document.createElement('span');
|
||||
link.classList.add('action');
|
||||
link.setAttribute('tabindex', 1);
|
||||
link.textContent = browserInspectorTitle;
|
||||
browserHeader.appendChild(link);
|
||||
link.addEventListener(
|
||||
'click',
|
||||
sendCommand.bind(
|
||||
null, 'inspect-browser', browser.source, browser.id,
|
||||
browserInspector),
|
||||
false);
|
||||
|
||||
pageList = document.createElement('div');
|
||||
pageList.className = 'list pages';
|
||||
|
@ -10,7 +10,7 @@ click of a button you can understand where memory is being used in your system.
|
||||
## Taking a memory-infra trace
|
||||
|
||||
1. [Record a trace as usual][record-trace]: open [chrome://tracing][tracing]
|
||||
on Desktop Chrome or [chrome://inspect?tracing][inspect-tracing] to trace
|
||||
on Desktop Chrome or [chrome://inspect][inspect-tracing] to trace
|
||||
Chrome for Android.
|
||||
|
||||
2. Make sure to enable the **memory-infra** category on the right.
|
||||
@ -20,7 +20,7 @@ click of a button you can understand where memory is being used in your system.
|
||||
|
||||
[record-trace]: https://sites.google.com/a/chromium.org/dev/developers/how-tos/trace-event-profiling-tool/recording-tracing-runs
|
||||
[tracing]: chrome://tracing
|
||||
[inspect-tracing]: chrome://inspect?tracing
|
||||
[inspect-tracing]: chrome://inspect
|
||||
[memory-infra-box]: https://storage.googleapis.com/chromium-docs.appspot.com/1c6d1886584e7cc6ffed0d377f32023f8da53e02
|
||||
|
||||
## Navigating a memory-infra trace
|
||||
|
Reference in New Issue
Block a user