Commit 303dd795 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

DevTools: Limit the script sources size retained solely by debugger.

BUG=v8:8988

Change-Id: I0a0cc3b95814656de1a602cc31bca2fe726dae79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1522193
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641659}
parent 0e03fcf2
......@@ -116,7 +116,11 @@ SDK.DebuggerModel = class extends SDK.SDKModel {
return Promise.resolve();
this._debuggerEnabled = true;
const enablePromise = this._agent.enable();
// Set a limit for the total size of collected script sources retained by debugger.
// 10MB for remote frontends, 100MB for others.
const isRemoteFrontend = Runtime.queryParam('remoteFrontend') || Runtime.queryParam('ws');
const maxScriptsCacheSize = isRemoteFrontend ? 10e6 : 100e6;
const enablePromise = this._agent.enable(maxScriptsCacheSize);
enablePromise.then(this._registerDebugger.bind(this));
this._pauseOnExceptionStateChanged();
this._asyncStackTracesStateChanged();
......
......@@ -9,7 +9,7 @@ frontend: {"id":<number>,"method":"Overlay.disable"}
frontend: {"id":<number>,"method":"Target.setAutoAttach","params":{"autoAttach":true,"waitForDebuggerOnStart":false,"flatten":true}}
--> SDK.targetManager.resumeAllTargets();
frontend: {"id":<number>,"method":"Debugger.enable"}
frontend: {"id":<number>,"method":"Debugger.enable","params":{"maxScriptsCacheSize":100000000}}
frontend: {"id":<number>,"method":"Debugger.setPauseOnExceptions","params":{"state":"none"}}
frontend: {"id":<number>,"method":"Debugger.setAsyncCallStackDepth","params":{"maxDepth":32}}
frontend: {"id":<number>,"method":"DOM.enable"}
......
......@@ -3,6 +3,9 @@ Tests the way service workers don't enable DOM agent and does enable Debugger ag
Debugger-related command should be issued: {
"id": "<id>",
"method": "Debugger.enable",
"params": {
"maxScriptsCacheSize": 100000000
},
"sessionId": "<id>"
}
Suspending targets.
......@@ -10,6 +13,9 @@ Resuming targets.
Debugger-related command should be issued: {
"id": "<id>",
"method": "Debugger.enable",
"params": {
"maxScriptsCacheSize": 100000000
},
"sessionId": "<id>"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment