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

Unified Diff: Source/devtools/front_end/common/Settings.js

Issue 413213003: DevTools: Support Blackbox/Disabled options in framework blackboxing UI dialog. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 6 years, 5 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/FrameworkBlackboxDialog.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/common/Settings.js
diff --git a/Source/devtools/front_end/common/Settings.js b/Source/devtools/front_end/common/Settings.js
index def7436396cd57c19686c156b960fecc7434512f..e1b111ad59b1162a70213e25a30597d49c6f7ea7 100644
--- a/Source/devtools/front_end/common/Settings.js
+++ b/Source/devtools/front_end/common/Settings.js
@@ -210,7 +210,7 @@ WebInspector.Setting.prototype = {
*/
WebInspector.RegExpSetting = function(name, defaultValue, eventSupport, storage, regexFlags)
{
- WebInspector.Setting.call(this, name, [defaultValue], eventSupport, storage);
+ WebInspector.Setting.call(this, name, defaultValue ? [{ pattern: defaultValue }] : [], eventSupport, storage);
this._regexFlags = regexFlags;
}
@@ -221,19 +221,22 @@ WebInspector.RegExpSetting.prototype = {
*/
get: function()
{
- return this.getAsArray().join("|");
+ var result = [];
+ var items = this.getAsArray();
+ for (var i = 0; i < items.length; ++i) {
+ var item = items[i];
+ if (item.pattern && !item.disabled)
+ result.push(item.pattern);
+ }
+ return result.join("|");
},
/**
- * @return {!Array.<string>}
+ * @return {!Array.<{pattern: string, disabled: (boolean|undefined)}>}
*/
getAsArray: function()
{
- var value = WebInspector.Setting.prototype.get.call(this);
- if (typeof value === "string") // Backward compatibility.
- value = [value];
- value.remove("");
- return value;
+ return WebInspector.Setting.prototype.get.call(this);
},
/**
@@ -242,16 +245,15 @@ WebInspector.RegExpSetting.prototype = {
*/
set: function(value)
{
- this.setAsArray([value]);
+ this.setAsArray([{ pattern: value }]);
},
/**
- * @param {!Array.<string>} value
+ * @param {!Array.<{pattern: string, disabled: (boolean|undefined)}>} value
*/
setAsArray: function(value)
{
delete this._regex;
- value.remove("");
WebInspector.Setting.prototype.set.call(this, value);
},
@@ -454,7 +456,7 @@ WebInspector.VersionController = function()
{
}
-WebInspector.VersionController.currentVersion = 8;
+WebInspector.VersionController.currentVersion = 9;
WebInspector.VersionController.prototype = {
updateVersion: function()
@@ -641,6 +643,36 @@ WebInspector.VersionController.prototype = {
setting.set(value);
},
+ _updateVersionFrom8To9: function()
+ {
+ if (!window.localStorage)
+ return;
+
+ var settingNames = [
+ "skipStackFramesPattern",
+ "workspaceFolderExcludePattern"
+ ];
+
+ for (var i = 0; i < settingNames.length; ++i) {
+ var settingName = settingNames[i];
+ if (!(settingName in window.localStorage))
+ continue;
+ try {
+ var value = JSON.parse(window.localStorage[settingName]);
+ if (!value)
+ continue;
+ if (typeof value === "string")
+ value = [value];
+ for (var j = 0; j < value.length; ++j) {
+ if (typeof value[j] === "string")
+ value[j] = { pattern: value[j] };
+ }
+ window.localStorage[settingName] = JSON.stringify(value);
+ } catch(e) {
+ }
+ }
+ },
+
/**
* @param {!WebInspector.Setting} breakpointsSetting
* @param {number} maxBreakpointsCount
« no previous file with comments | « no previous file | Source/devtools/front_end/settings/FrameworkBlackboxDialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698