| 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 } | 692 } |
| 693 | 693 |
| 694 _updateVersionFrom20To21() { | 694 _updateVersionFrom20To21() { |
| 695 var networkColumns = Common.settings.createSetting('networkLogColumns', {}); | 695 var networkColumns = Common.settings.createSetting('networkLogColumns', {}); |
| 696 var columns = /** @type {!Object} */ (networkColumns.get()); | 696 var columns = /** @type {!Object} */ (networkColumns.get()); |
| 697 delete columns['timeline']; | 697 delete columns['timeline']; |
| 698 delete columns['waterfall']; | 698 delete columns['waterfall']; |
| 699 networkColumns.set(columns); | 699 networkColumns.set(columns); |
| 700 } | 700 } |
| 701 | 701 |
| 702 _updateVersionFrom21To22() { |
| 703 var breakpointsSetting = Common.settings.createLocalSetting('breakpoints', [
]); |
| 704 var breakpoints = breakpointsSetting.get(); |
| 705 for (var breakpoint of breakpoints) { |
| 706 breakpoint['url'] = breakpoint['sourceFileId']; |
| 707 delete breakpoint['sourceFileId']; |
| 708 } |
| 709 breakpointsSetting.set(breakpoints); |
| 710 } |
| 711 |
| 702 _migrateSettingsFromLocalStorage() { | 712 _migrateSettingsFromLocalStorage() { |
| 703 // This step migrates all the settings except for the ones below into the br
owser profile. | 713 // This step migrates all the settings except for the ones below into the br
owser profile. |
| 704 var localSettings = new Set([ | 714 var localSettings = new Set([ |
| 705 'advancedSearchConfig', 'breakpoints', 'consoleHistory', 'domBreakpoints',
'eventListenerBreakpoints', | 715 'advancedSearchConfig', 'breakpoints', 'consoleHistory', 'domBreakpoints',
'eventListenerBreakpoints', |
| 706 'fileSystemMapping', 'lastSelectedSourcesSidebarPaneTab', 'previouslyViewe
dFiles', 'savedURLs', | 716 'fileSystemMapping', 'lastSelectedSourcesSidebarPaneTab', 'previouslyViewe
dFiles', 'savedURLs', |
| 707 'watchExpressions', 'workspaceExcludedFolders', 'xhrBreakpoints' | 717 'watchExpressions', 'workspaceExcludedFolders', 'xhrBreakpoints' |
| 708 ]); | 718 ]); |
| 709 if (!window.localStorage) | 719 if (!window.localStorage) |
| 710 return; | 720 return; |
| 711 | 721 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 724 */ | 734 */ |
| 725 _clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) { | 735 _clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) { |
| 726 // If there are too many breakpoints in a storage, it is likely due to a rec
ent bug that caused | 736 // If there are too many breakpoints in a storage, it is likely due to a rec
ent bug that caused |
| 727 // periodical breakpoints duplication leading to inspector slowness. | 737 // periodical breakpoints duplication leading to inspector slowness. |
| 728 if (breakpointsSetting.get().length > maxBreakpointsCount) | 738 if (breakpointsSetting.get().length > maxBreakpointsCount) |
| 729 breakpointsSetting.set([]); | 739 breakpointsSetting.set([]); |
| 730 } | 740 } |
| 731 }; | 741 }; |
| 732 | 742 |
| 733 Common.VersionController._currentVersionName = 'inspectorVersion'; | 743 Common.VersionController._currentVersionName = 'inspectorVersion'; |
| 734 Common.VersionController.currentVersion = 21; | 744 Common.VersionController.currentVersion = 22; |
| 735 | 745 |
| 736 /** | 746 /** |
| 737 * @type {!Common.Settings} | 747 * @type {!Common.Settings} |
| 738 */ | 748 */ |
| 739 Common.settings; | 749 Common.settings; |
| 740 | 750 |
| 741 /** | 751 /** |
| 742 * @param {string} settingName | 752 * @param {string} settingName |
| 743 * @return {!Common.Setting} | 753 * @return {!Common.Setting} |
| 744 */ | 754 */ |
| 745 Common.moduleSetting = function(settingName) { | 755 Common.moduleSetting = function(settingName) { |
| 746 return Common.settings.moduleSetting(settingName); | 756 return Common.settings.moduleSetting(settingName); |
| 747 }; | 757 }; |
| 748 | 758 |
| 749 /** | 759 /** |
| 750 * @param {string} settingName | 760 * @param {string} settingName |
| 751 * @return {!Common.Setting} | 761 * @return {!Common.Setting} |
| 752 */ | 762 */ |
| 753 Common.settingForTest = function(settingName) { | 763 Common.settingForTest = function(settingName) { |
| 754 return Common.settings.settingForTest(settingName); | 764 return Common.settings.settingForTest(settingName); |
| 755 }; | 765 }; |
| OLD | NEW |