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

Unified Diff: Source/devtools/front_end/FileSystemMapping.js

Issue 212223003: DevTools: Introduce WebInspector.RegExpSetting. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/devtools/front_end/Settings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/FileSystemMapping.js
diff --git a/Source/devtools/front_end/FileSystemMapping.js b/Source/devtools/front_end/FileSystemMapping.js
index 6ef139ed0b167cc1d25464cd18073feb724292a7..93743d77ca18383a75bdf6831d67634b9736f924 100644
--- a/Source/devtools/front_end/FileSystemMapping.js
+++ b/Source/devtools/front_end/FileSystemMapping.js
@@ -72,7 +72,7 @@ WebInspector.FileSystemMapping = function()
else
defaultExcludedFolders = defaultExcludedFolders.concat(defaultLinuxExcludedFolders);
var defaultExcludedFoldersPattern = defaultExcludedFolders.join("|");
- WebInspector.settings.workspaceFolderExcludePattern = WebInspector.settings.createSetting("workspaceFolderExcludePattern", defaultExcludedFoldersPattern);
+ WebInspector.settings.workspaceFolderExcludePattern = WebInspector.settings.createRegExpSetting("workspaceFolderExcludePattern", defaultExcludedFoldersPattern, WebInspector.isWin() ? "i" : "");
/** @type {!Object.<string, !Array.<!WebInspector.FileSystemMapping.Entry>>} */
this._fileSystemMappings = {};
/** @type {!Object.<string, !Array.<!WebInspector.FileSystemMapping.ExcludedFolderEntry>>} */
@@ -121,13 +121,6 @@ WebInspector.FileSystemMapping.prototype = {
}
}
- var workspaceFolderExcludePattern = WebInspector.settings.workspaceFolderExcludePattern.get()
- try {
- var flags = WebInspector.isWin() ? "i" : "";
- this._workspaceFolderExcludeRegex = workspaceFolderExcludePattern ? new RegExp(workspaceFolderExcludePattern, flags) : null;
- } catch (e) {
- }
-
this._rebuildIndexes();
},
@@ -329,7 +322,8 @@ WebInspector.FileSystemMapping.prototype = {
if (entry.path === folderPath)
return true;
}
- return this._workspaceFolderExcludeRegex && this._workspaceFolderExcludeRegex.test(folderPath);
+ var regex = WebInspector.settings.workspaceFolderExcludePattern.asRegExp();
+ return regex && regex.test(folderPath);
},
/**
« no previous file with comments | « no previous file | Source/devtools/front_end/Settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698