提交 a2898d57 编写于 作者: J Johannes Rieken

implement chooseTab when connecting to the renderer, #58929

上级 67aec4ac
......@@ -274,7 +274,7 @@ export async function main(argv: string[]): Promise<any> {
processCallbacks.push(async _child => {
class Profiler {
static async start(name: string, filenamePrefix: string, opts: { port: number, tries?: number }) {
static async start(name: string, filenamePrefix: string, opts: { port: number, tries?: number, chooseTab?: Function }) {
const profiler = await import('v8-inspect-profiler');
let session: ProfilingSession;
......@@ -309,8 +309,24 @@ export async function main(argv: string[]): Promise<any> {
try {
// load and start profiler
const main = await Profiler.start('main', filenamePrefix, { port: portMain });
const renderer = await Profiler.start('renderer', filenamePrefix, { port: portRenderer, tries: 200 });
const extHost = await Profiler.start('extHost', filenamePrefix, { port: portExthost, tries: 300 });
const renderer = await Profiler.start('renderer', filenamePrefix, {
port: portRenderer,
tries: 200,
chooseTab: function (targets) {
console.log(targets);
return targets.find(target => {
if (!target.webSocketDebuggerUrl) {
return false;
}
if (target.type === 'page') {
return target.url.indexOf('workbench/workbench.html') > 0;
} else {
return true;
}
});
}
});
// wait for the renderer to delete the
// marker file
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册