| Index: third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
|
| index a848f1a8549fded057d40b0031014aa855109dd4..89e14cd1a0a604bf928087636797ec2c9959ac52 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
|
| @@ -6,9 +6,12 @@
|
| * @constructor
|
| * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding
|
| * @param {!WebInspector.NetworkMapping} networkMapping
|
| + * @implements {WebInspector.TargetManager.Observer}
|
| */
|
| WebInspector.BlackboxManager = function(debuggerWorkspaceBinding, networkMapping)
|
| {
|
| + WebInspector.targetManager.observeTargets(this);
|
| +
|
| this._debuggerWorkspaceBinding = debuggerWorkspaceBinding;
|
| this._networkMapping = networkMapping;
|
|
|
| @@ -17,6 +20,7 @@ WebInspector.BlackboxManager = function(debuggerWorkspaceBinding, networkMapping
|
| WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this._patternChanged.bind(this));
|
| WebInspector.moduleSetting("skipContentScripts").addChangeListener(this._patternChanged.bind(this));
|
|
|
| +
|
| /** @type {!Map<!WebInspector.DebuggerModel, !Map<string, !Array<!DebuggerAgent.ScriptPosition>>>} */
|
| this._debuggerModelData = new Map();
|
| /** @type {!Map<string, boolean>} */
|
| @@ -154,6 +158,40 @@ WebInspector.BlackboxManager.prototype = {
|
| },
|
|
|
| /**
|
| + * @override
|
| + * @param {!WebInspector.Target} target
|
| + */
|
| + targetAdded: function(target)
|
| + {
|
| + var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
|
| + if (debuggerModel)
|
| + this._editBlackboxPatterns(debuggerModel);
|
| + },
|
| +
|
| + /**
|
| + * @override
|
| + * @param {!WebInspector.Target} target
|
| + */
|
| + targetRemoved: function(target)
|
| + {
|
| + },
|
| +
|
| + /**
|
| + * @param {!WebInspector.DebuggerModel} debuggerModel
|
| + * @return {!Promise<boolean>}
|
| + */
|
| + _editBlackboxPatterns: function(debuggerModel)
|
| + {
|
| + var regexPatterns = WebInspector.moduleSetting("skipStackFramesPattern").getAsArray();
|
| + var patterns = /** @type {!Array<!DebuggerAgent.BlackboxPattern>} */([]);
|
| + for (var item of regexPatterns) {
|
| + if (!item.disabled && item.pattern)
|
| + patterns.push({ regex: item.pattern });
|
| + }
|
| + return debuggerModel.editBlackboxPatterns(patterns);
|
| + },
|
| +
|
| + /**
|
| * @param {!WebInspector.UISourceCode} uiSourceCode
|
| * @return {?string}
|
| */
|
| @@ -267,6 +305,7 @@ WebInspector.BlackboxManager.prototype = {
|
| promises.push(this._addScript(script)
|
| .then(loadSourceMap.bind(this, script)));
|
| }
|
| + promises.push(this._editBlackboxPatterns(debuggerModel));
|
| }
|
| Promise.all(promises).then(this._patternChangeFinishedForTests);
|
|
|
| @@ -367,7 +406,7 @@ WebInspector.BlackboxManager.prototype = {
|
| return Promise.resolve().then(updateState.bind(this, false));
|
| }
|
|
|
| - return script.setBlackboxedRanges(positions).then(updateState.bind(this));
|
| + return script.addBlackboxRanges(positions).then(updateState.bind(this));
|
|
|
| /**
|
| * @param {boolean} success
|
|
|