Skip to content

Commit d058e13

Browse files
committed
Cleanup the webkit debug adapter
1 parent cd1a68d commit d058e13

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

src/debug-adapter/utilities.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,37 +59,6 @@ export function existsSync(path: string): boolean {
5959
}
6060
}
6161

62-
export class DebounceHelper {
63-
private waitToken: NodeJS.Timer;
64-
65-
constructor(private timeoutMs: number) { }
66-
67-
/**
68-
* If not waiting already, call fn after the timeout
69-
*/
70-
public wait(fn: () => any): void {
71-
if (!this.waitToken) {
72-
this.waitToken = setTimeout(() => {
73-
this.waitToken = null;
74-
fn();
75-
},
76-
this.timeoutMs);
77-
}
78-
}
79-
80-
/**
81-
* If waiting for something, cancel it and call fn immediately
82-
*/
83-
public doAndCancel(fn: () => any): void {
84-
if (this.waitToken) {
85-
clearTimeout(this.waitToken);
86-
this.waitToken = null;
87-
}
88-
89-
fn();
90-
}
91-
}
92-
9362
/**
9463
* Returns a reversed version of arr. Doesn't modify the input.
9564
*/

src/debug-adapter/webKitDebugAdapter.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
2929

3030
private _initArgs: DebugProtocol.InitializeRequestArguments;
3131

32-
private _clientAttached: boolean;
3332
private _variableHandles: Handles<IScopeVarHandle>;
3433
private _currentStack: WebKitProtocol.Debugger.CallFrame[];
3534
private _committedBreakpointsByUrl: Map<string, WebKitProtocol.Debugger.BreakpointId[]>;
36-
private _overlayHelper: utils.DebounceHelper;
3735
private _exceptionValueObject: WebKitProtocol.Runtime.RemoteObject;
3836
private _expectingResumedEvent: boolean;
3937
private _scriptsById: Map<WebKitProtocol.Debugger.ScriptId, WebKitProtocol.Debugger.Script>;
4038
private _setBreakpointsRequestQ: Promise<any>;
41-
42-
private _chromeProc: ChildProcess;
4339
private _webKitConnection: INSDebugConnection;
4440
private _eventHandler: (event: DebugProtocol.Event) => void;
4541
private appRoot: string;
@@ -49,7 +45,6 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
4945

5046
public constructor() {
5147
this._variableHandles = new Handles<IScopeVarHandle>();
52-
this._overlayHelper = new utils.DebounceHelper(/*timeoutMs=*/200);
5348

5449
// Messages tagged with a special tag are sent to the frontend through the debugging protocol
5550
Logger.addHandler(this._loggerFrontendHandler, [Tags.FrontendMessage]);
@@ -72,7 +67,6 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
7267
}
7368

7469
private clearClientContext(): void {
75-
this._clientAttached = false;
7670
this.fireEvent({ seq: 0, type: 'event', event: 'clearClientContext'});
7771
}
7872

@@ -208,9 +202,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
208202
}
209203

210204
private terminateSession(): void {
211-
if (this._clientAttached) {
212-
this.fireEvent(new TerminatedEvent());
213-
}
205+
//this.fireEvent(new TerminatedEvent());
214206

215207
Logger.log("Terminating debug session");
216208
this.clearEverything();
@@ -219,7 +211,6 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
219211
private clearEverything(): void {
220212
this.clearClientContext();
221213
this.clearTargetContext();
222-
this._chromeProc = null;
223214

224215
if (this._webKitConnection) {
225216
Logger.log("Closing debug connection");
@@ -333,11 +324,6 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
333324
}
334325

335326
public disconnect(): Promise<void> {
336-
if (this._chromeProc) {
337-
this._chromeProc.kill('SIGINT');
338-
this._chromeProc = null;
339-
}
340-
341327
this.clearEverything();
342328

343329
return Promise.resolve<void>();

0 commit comments

Comments
 (0)