From 017eeef5e0c2584dbcc4c2b3eb24f73efacb0ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Z=C3=BCnd?= Date: Fri, 17 Jun 2022 10:11:17 +0200 Subject: [PATCH] [liveedit] Remove obsolete stack trace result parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CL https://crrev.com/c/3691850 deprecated result parameters of Debugger#setScriptSource and changed the CDP method to always leave them out. This means we no longer have to handle them on the frontend side. Moreover, as live edit can no longer change functions that are on the stack (for now), we don't have to explicitly "step in" to trigger frame restarting. The new version will handle that automatically for us in the backend. R=kimanh@chromium.org Bug: 1334484 Change-Id: I7104a77ea36cdb7eadcbbe022104a78d9eae07f0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3707818 Reviewed-by: Kim-Anh Tran Commit-Queue: Simon Zünd --- front_end/core/sdk/DebuggerModel.ts | 21 +-------------------- front_end/core/sdk/Script.ts | 10 ++-------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/front_end/core/sdk/DebuggerModel.ts b/front_end/core/sdk/DebuggerModel.ts index 392291380e..3cffa98d3b 100644 --- a/front_end/core/sdk/DebuggerModel.ts +++ b/front_end/core/sdk/DebuggerModel.ts @@ -585,26 +585,7 @@ export class DebuggerModel extends SDKModel { callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void): void { const script = this.#scriptsInternal.get(scriptId); if (script) { - void script.editSource(newSource, this.didEditScriptSource.bind(this, scriptId, newSource, callback)); - } - } - - private didEditScriptSource( - scriptId: string, newSource: string, - callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void, error: string|null, - exceptionDetails?: Protocol.Runtime.ExceptionDetails, callFrames?: Protocol.Debugger.CallFrame[], - asyncStackTrace?: Protocol.Runtime.StackTrace, asyncStackTraceId?: Protocol.Runtime.StackTraceId, - needsStepIn?: boolean): void { - callback(error, exceptionDetails); - if (needsStepIn) { - void this.stepInto(); - return; - } - - if (!error && callFrames && callFrames.length && this.#debuggerPausedDetailsInternal) { - void this.pausedScript( - callFrames, this.#debuggerPausedDetailsInternal.reason, this.#debuggerPausedDetailsInternal.auxData, - this.#debuggerPausedDetailsInternal.breakpointIds, asyncStackTrace, asyncStackTraceId); + void script.editSource(newSource, callback); } } diff --git a/front_end/core/sdk/Script.ts b/front_end/core/sdk/Script.ts index 69d5b1e0ec..6662aecc6e 100644 --- a/front_end/core/sdk/Script.ts +++ b/front_end/core/sdk/Script.ts @@ -259,10 +259,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA async editSource( newSource: string, - callback: - (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined, - arg2?: Array|undefined, arg3?: Protocol.Runtime.StackTrace|undefined, - arg4?: Protocol.Runtime.StackTraceId|undefined, arg5?: boolean|undefined) => void): Promise { + callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void): Promise { newSource = Script.trimSourceURLComment(newSource); // We append correct #sourceURL to script for consistency only. It's not actually needed for things to work correctly. newSource = this.appendSourceURLCommentIfNeeded(newSource); @@ -284,10 +281,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA this.#contentPromise = Promise.resolve({content: newSource, isEncoded: false}); } - const needsStepIn = Boolean(response.stackChanged); - callback( - response.getError() || null, response.exceptionDetails, response.callFrames, response.asyncStackTrace, - response.asyncStackTraceId, needsStepIn); + callback(response.getError() || null, response.exceptionDetails); } rawLocation(lineNumber: number, columnNumber: number): Location|null {