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

Unified Diff: Source/devtools/front_end/sdk/BlackboxSupport.js

Issue 458583004: DevTools: Remove autogenerated blackbox patterns upon Unblackbox user action. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/BlackboxSupport.js
diff --git a/Source/devtools/front_end/sdk/BlackboxSupport.js b/Source/devtools/front_end/sdk/BlackboxSupport.js
index 82e9d149a4bd81258627ddd80bd22e57c7a8ad11..96f1b7d117464d53d8b6c021f29665405478cc4f 100644
--- a/Source/devtools/front_end/sdk/BlackboxSupport.js
+++ b/Source/devtools/front_end/sdk/BlackboxSupport.js
@@ -8,12 +8,21 @@ WebInspector.BlackboxSupport = function()
/**
* @param {string} url
+ * @return {string}
+ */
+WebInspector.BlackboxSupport._urlToRegExpString = function(url)
+{
+ var name = new WebInspector.ParsedURL(url).lastPathComponent;
+ return "/" + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\b");
+}
+
+/**
+ * @param {string} url
*/
WebInspector.BlackboxSupport.blackboxURL = function(url)
{
var regexPatterns = WebInspector.settings.skipStackFramesPattern.getAsArray();
- var name = new WebInspector.ParsedURL(url).lastPathComponent;
- var regexValue = "/" + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\b");
+ var regexValue = WebInspector.BlackboxSupport._urlToRegExpString(url);
var found = false;
for (var i = 0; i < regexPatterns.length; ++i) {
var item = regexPatterns[i];
@@ -34,6 +43,10 @@ WebInspector.BlackboxSupport.blackboxURL = function(url)
WebInspector.BlackboxSupport.unblackboxURL = function(url)
{
var regexPatterns = WebInspector.settings.skipStackFramesPattern.getAsArray();
+ var regexValue = WebInspector.BlackboxSupport._urlToRegExpString(url);
+ regexPatterns = regexPatterns.filter(function(item) {
+ return item.pattern !== regexValue;
+ });
for (var i = 0; i < regexPatterns.length; ++i) {
var item = regexPatterns[i];
if (item.disabled)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698