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

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, 10 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 a848f1a8549fded057d40b0031014aa855109dd4..f694af2fb3787f4c9036a23301ecc9b708035de3 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,37 @@ WebInspector.BlackboxManager.prototype = {
},
/**
+ * @override
+ * @param {!WebInspector.Target} target
+ */
+ targetAdded: function(target)
+ {
+ var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
+ if (debuggerModel)
+ this._setBlackboxPatterns(debuggerModel);
+ },
+
+ /**
+ * @override
+ * @param {!WebInspector.Target} target
+ */
+ targetRemoved: function(target)
+ {
+ },
+
+ /**
+ * @param {!WebInspector.DebuggerModel} debuggerModel
+ * @return {!Promise<boolean>}
+ */
+ _setBlackboxPatterns: function(debuggerModel)
+ {
+ var regexPatterns = WebInspector.moduleSetting("skipStackFramesPattern").getAsArray()
+ .filter(item => !item.disabled)
pfeldman 2016/03/03 01:25:39 Did closure compiler resolve item type?
+ .map(item => ({ type: "RegExp", value: item.pattern }));
+ return debuggerModel.setBlackboxPatterns(regexPatterns);
pfeldman 2016/03/03 01:25:39 It could not possibly resolve this type, so it is
kozy 2016/03/03 20:14:18 Rewrited without awesome filter and map with array
+ },
+
+ /**
* @param {!WebInspector.UISourceCode} uiSourceCode
* @return {?string}
*/
@@ -267,6 +302,7 @@ WebInspector.BlackboxManager.prototype = {
promises.push(this._addScript(script)
.then(loadSourceMap.bind(this, script)));
}
+ promises.push(this._setBlackboxPatterns(debuggerModel));
}
Promise.all(promises).then(this._patternChangeFinishedForTests);
@@ -367,7 +403,7 @@ WebInspector.BlackboxManager.prototype = {
return Promise.resolve().then(updateState.bind(this, false));
}
- return script.setBlackboxedRanges(positions).then(updateState.bind(this));
+ return script.setBlackboxRanges(positions).then(updateState.bind(this));
/**
* @param {boolean} success

Powered by Google App Engine
This is Rietveld 408576698