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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/common/Settings.js

Issue 2938503002: DevTools: unify Network & CPU throttling (Closed)
Patch Set: fmt Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 } 776 }
777 777
778 _updateVersionFrom24To25() { 778 _updateVersionFrom24To25() {
779 var defaultColumns = {status: true, type: true, initiator: true, size: true, time: true}; 779 var defaultColumns = {status: true, type: true, initiator: true, size: true, time: true};
780 var networkLogColumnsSetting = Common.settings.createSetting('networkLogColu mns', defaultColumns); 780 var networkLogColumnsSetting = Common.settings.createSetting('networkLogColu mns', defaultColumns);
781 var columns = networkLogColumnsSetting.get(); 781 var columns = networkLogColumnsSetting.get();
782 delete columns.product; 782 delete columns.product;
783 networkLogColumnsSetting.set(columns); 783 networkLogColumnsSetting.set(columns);
784 } 784 }
785 785
786 _updateVersionFrom25To26() {
787 var oldSetting = Common.settings.createSetting('customNetworkConditions', [] );
788 var newSetting = Common.settings.createSetting('customThrottlingConditions', []);
789 newSetting.set(oldSetting.get().map(setting => Object.assign({cpuThrottlingR ate: 1}, setting)));
790 oldSetting.remove();
791 }
792
786 _migrateSettingsFromLocalStorage() { 793 _migrateSettingsFromLocalStorage() {
787 // This step migrates all the settings except for the ones below into the br owser profile. 794 // This step migrates all the settings except for the ones below into the br owser profile.
788 var localSettings = new Set([ 795 var localSettings = new Set([
789 'advancedSearchConfig', 'breakpoints', 'consoleHistory', 'domBreakpoints', 'eventListenerBreakpoints', 796 'advancedSearchConfig', 'breakpoints', 'consoleHistory', 'domBreakpoints', 'eventListenerBreakpoints',
790 'fileSystemMapping', 'lastSelectedSourcesSidebarPaneTab', 'previouslyViewe dFiles', 'savedURLs', 797 'fileSystemMapping', 'lastSelectedSourcesSidebarPaneTab', 'previouslyViewe dFiles', 'savedURLs',
791 'watchExpressions', 'workspaceExcludedFolders', 'xhrBreakpoints' 798 'watchExpressions', 'workspaceExcludedFolders', 'xhrBreakpoints'
792 ]); 799 ]);
793 if (!window.localStorage) 800 if (!window.localStorage)
794 return; 801 return;
795 802
(...skipping 12 matching lines...) Expand all
808 */ 815 */
809 _clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) { 816 _clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) {
810 // If there are too many breakpoints in a storage, it is likely due to a rec ent bug that caused 817 // If there are too many breakpoints in a storage, it is likely due to a rec ent bug that caused
811 // periodical breakpoints duplication leading to inspector slowness. 818 // periodical breakpoints duplication leading to inspector slowness.
812 if (breakpointsSetting.get().length > maxBreakpointsCount) 819 if (breakpointsSetting.get().length > maxBreakpointsCount)
813 breakpointsSetting.set([]); 820 breakpointsSetting.set([]);
814 } 821 }
815 }; 822 };
816 823
817 Common.VersionController._currentVersionName = 'inspectorVersion'; 824 Common.VersionController._currentVersionName = 'inspectorVersion';
818 Common.VersionController.currentVersion = 25; 825 Common.VersionController.currentVersion = 26;
819 826
820 /** 827 /**
821 * @type {!Common.Settings} 828 * @type {!Common.Settings}
822 */ 829 */
823 Common.settings; 830 Common.settings;
824 831
825 /** 832 /**
826 * @enum {symbol} 833 * @enum {symbol}
827 */ 834 */
828 Common.SettingStorageType = { 835 Common.SettingStorageType = {
(...skipping 10 matching lines...) Expand all
839 return Common.settings.moduleSetting(settingName); 846 return Common.settings.moduleSetting(settingName);
840 }; 847 };
841 848
842 /** 849 /**
843 * @param {string} settingName 850 * @param {string} settingName
844 * @return {!Common.Setting} 851 * @return {!Common.Setting}
845 */ 852 */
846 Common.settingForTest = function(settingName) { 853 Common.settingForTest = function(settingName) {
847 return Common.settings.settingForTest(settingName); 854 return Common.settings.settingForTest(settingName);
848 }; 855 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698