Skip to content

Chrome DevTools for coding agents

refactor: rename methods for clarity (#2442)

Nikolay Vitkovdc23bcd894a8
diff --git a/src/HeapSnapshotManager.ts b/src/HeapSnapshotManager.ts
index c335a874..0d01cf88 100644
--- a/src/HeapSnapshotManager.ts
+++ b/src/HeapSnapshotManager.ts
@@ -393,7 +393,7 @@ export class HeapSnapshotManager {
return this.#snapshots.size > 0;
}
- dispose(filePath: string): boolean {
+ disposeSnapshot(filePath: string): boolean {
const absolutePath = path.resolve(filePath);
const cached = this.#snapshots.get(absolutePath);
if (cached) {
@@ -404,7 +404,7 @@ export class HeapSnapshotManager {
return false;
}
- disposeAll(): void {
+ dispose(): void {
for (const cached of this.#snapshots.values()) {
cached.worker.dispose();
}
diff --git a/src/McpContext.ts b/src/McpContext.ts
index b078e4a5..be54198a 100644
--- a/src/McpContext.ts
+++ b/src/McpContext.ts
@@ -139,7 +139,7 @@ export class McpContext implements Context {
this.browser.off('targetdestroyed', this.#onTargetDestroyed);
this.#serviceWorkerConsoleCollector.dispose();
- this.#heapSnapshotManager.disposeAll();
+ this.#heapSnapshotManager.dispose();
for (const mcpPage of this.#mcpPages.values()) {
mcpPage.dispose();
}
@@ -722,7 +722,7 @@ export class McpContext implements Context {
}
async closeHeapSnapshot(filePath: string): Promise<boolean> {
- return this.#heapSnapshotManager.dispose(filePath);
+ return this.#heapSnapshotManager.disposeSnapshot(filePath);
}
hasHeapSnapshots(): boolean {