Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js

Issue 1754483002: [DevTools] Added setBlackboxPatterns method to protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@provide-hash-for-anonymous-scripts
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 98fc9c29eebbd6d256d323c13490c2b18290a30b..4c9ae4b1e6021747fc8646302045281d6306ada9 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);
dgozman 2016/03/07 17:26:13 Better do this at the end, after all fields have b
kozy 2016/03/08 02:33:20 Done.
+
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>} */
@@ -149,6 +153,40 @@ WebInspector.BlackboxManager.prototype = {
},
/**
+ * @override
+ * @param {!WebInspector.Target} target
+ */
+ targetAdded: function(target)
+ {
+ var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
+ if (debuggerModel)
+ this._addBlackboxPatterns(debuggerModel);
+ },
+
+ /**
+ * @override
+ * @param {!WebInspector.Target} target
+ */
+ targetRemoved: function(target)
+ {
+ },
+
+ /**
+ * @param {!WebInspector.DebuggerModel} debuggerModel
+ * @return {!Promise<boolean>}
+ */
+ _addBlackboxPatterns: 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({ regexp: item.pattern });
+ }
+ return debuggerModel.addBlackboxPatterns(patterns);
+ },
+
+ /**
* @param {!WebInspector.UISourceCode} uiSourceCode
* @return {?string}
*/
@@ -262,6 +300,7 @@ WebInspector.BlackboxManager.prototype = {
promises.push(this._addScript(script)
.then(loadSourceMap.bind(this, script)));
}
+ promises.push(this._addBlackboxPatterns(debuggerModel));
dgozman 2016/03/07 17:26:13 Clear patterns before adding them again.
kozy 2016/03/08 02:33:20 Done.
}
Promise.all(promises).then(this._patternChangeFinishedForTests.bind(this));
@@ -362,7 +401,7 @@ WebInspector.BlackboxManager.prototype = {
return Promise.resolve().then(updateState.bind(this, false));
}
- return script.setBlackboxedRanges(positions).then(updateState.bind(this));
+ return script.addBlackboxPattern(positions).then(updateState.bind(this));
/**
* @param {boolean} success

Powered by Google App Engine
This is Rietveld 408576698