Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 _updateVersionFrom21To22() { | 702 _updateVersionFrom21To22() { |
| 703 var breakpointsSetting = Common.settings.createLocalSetting('breakpoints', [ ]); | 703 var breakpointsSetting = Common.settings.createLocalSetting('breakpoints', [ ]); |
| 704 var breakpoints = breakpointsSetting.get(); | 704 var breakpoints = breakpointsSetting.get(); |
| 705 for (var breakpoint of breakpoints) { | 705 for (var breakpoint of breakpoints) { |
| 706 breakpoint['url'] = breakpoint['sourceFileId']; | 706 breakpoint['url'] = breakpoint['sourceFileId']; |
| 707 delete breakpoint['sourceFileId']; | 707 delete breakpoint['sourceFileId']; |
| 708 } | 708 } |
| 709 breakpointsSetting.set(breakpoints); | 709 breakpointsSetting.set(breakpoints); |
| 710 } | 710 } |
| 711 | 711 |
| 712 _updateVersionFrom22To23() { | |
|
pfeldman
2017/02/07 18:38:14
Lets not switch to the short/long, this adds anoth
| |
| 713 var oldSetting = Common.settings.createSetting('consoleTimestampsEnabled', f alse); | |
| 714 var newSetting = Common.settings.createSetting('consoleTimestampFormat', 'no ne'); | |
| 715 var oldValue = oldSetting.get(); | |
| 716 if (oldValue) | |
| 717 newSetting.set('short'); | |
| 718 oldSetting.remove(); | |
| 719 } | |
| 720 | |
| 712 _migrateSettingsFromLocalStorage() { | 721 _migrateSettingsFromLocalStorage() { |
| 713 // This step migrates all the settings except for the ones below into the br owser profile. | 722 // This step migrates all the settings except for the ones below into the br owser profile. |
| 714 var localSettings = new Set([ | 723 var localSettings = new Set([ |
| 715 'advancedSearchConfig', 'breakpoints', 'consoleHistory', 'domBreakpoints', 'eventListenerBreakpoints', | 724 'advancedSearchConfig', 'breakpoints', 'consoleHistory', 'domBreakpoints', 'eventListenerBreakpoints', |
| 716 'fileSystemMapping', 'lastSelectedSourcesSidebarPaneTab', 'previouslyViewe dFiles', 'savedURLs', | 725 'fileSystemMapping', 'lastSelectedSourcesSidebarPaneTab', 'previouslyViewe dFiles', 'savedURLs', |
| 717 'watchExpressions', 'workspaceExcludedFolders', 'xhrBreakpoints' | 726 'watchExpressions', 'workspaceExcludedFolders', 'xhrBreakpoints' |
| 718 ]); | 727 ]); |
| 719 if (!window.localStorage) | 728 if (!window.localStorage) |
| 720 return; | 729 return; |
| 721 | 730 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 734 */ | 743 */ |
| 735 _clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) { | 744 _clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) { |
| 736 // If there are too many breakpoints in a storage, it is likely due to a rec ent bug that caused | 745 // If there are too many breakpoints in a storage, it is likely due to a rec ent bug that caused |
| 737 // periodical breakpoints duplication leading to inspector slowness. | 746 // periodical breakpoints duplication leading to inspector slowness. |
| 738 if (breakpointsSetting.get().length > maxBreakpointsCount) | 747 if (breakpointsSetting.get().length > maxBreakpointsCount) |
| 739 breakpointsSetting.set([]); | 748 breakpointsSetting.set([]); |
| 740 } | 749 } |
| 741 }; | 750 }; |
| 742 | 751 |
| 743 Common.VersionController._currentVersionName = 'inspectorVersion'; | 752 Common.VersionController._currentVersionName = 'inspectorVersion'; |
| 744 Common.VersionController.currentVersion = 22; | 753 Common.VersionController.currentVersion = 23; |
| 745 | 754 |
| 746 /** | 755 /** |
| 747 * @type {!Common.Settings} | 756 * @type {!Common.Settings} |
| 748 */ | 757 */ |
| 749 Common.settings; | 758 Common.settings; |
| 750 | 759 |
| 751 /** | 760 /** |
| 752 * @param {string} settingName | 761 * @param {string} settingName |
| 753 * @return {!Common.Setting} | 762 * @return {!Common.Setting} |
| 754 */ | 763 */ |
| 755 Common.moduleSetting = function(settingName) { | 764 Common.moduleSetting = function(settingName) { |
| 756 return Common.settings.moduleSetting(settingName); | 765 return Common.settings.moduleSetting(settingName); |
| 757 }; | 766 }; |
| 758 | 767 |
| 759 /** | 768 /** |
| 760 * @param {string} settingName | 769 * @param {string} settingName |
| 761 * @return {!Common.Setting} | 770 * @return {!Common.Setting} |
| 762 */ | 771 */ |
| 763 Common.settingForTest = function(settingName) { | 772 Common.settingForTest = function(settingName) { |
| 764 return Common.settings.settingForTest(settingName); | 773 return Common.settings.settingForTest(settingName); |
| 765 }; | 774 }; |
| OLD | NEW |