| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 326 } |
| 327 | 327 |
| 328 /** | 328 /** |
| 329 * @constructor | 329 * @constructor |
| 330 */ | 330 */ |
| 331 WebInspector.VersionController = function() | 331 WebInspector.VersionController = function() |
| 332 { | 332 { |
| 333 } | 333 } |
| 334 | 334 |
| 335 WebInspector.VersionController._currentVersionName = "inspectorVersion"; | 335 WebInspector.VersionController._currentVersionName = "inspectorVersion"; |
| 336 WebInspector.VersionController.currentVersion = 12; | 336 WebInspector.VersionController.currentVersion = 13; |
| 337 | 337 |
| 338 WebInspector.VersionController.prototype = { | 338 WebInspector.VersionController.prototype = { |
| 339 updateVersion: function() | 339 updateVersion: function() |
| 340 { | 340 { |
| 341 var localStorageVersion = window.localStorage ? window.localStorage[WebI
nspector.VersionController._currentVersionName] : 0; | 341 var localStorageVersion = window.localStorage ? window.localStorage[WebI
nspector.VersionController._currentVersionName] : 0; |
| 342 var versionSetting = WebInspector.settings.createSetting(WebInspector.Ve
rsionController._currentVersionName, 0); | 342 var versionSetting = WebInspector.settings.createSetting(WebInspector.Ve
rsionController._currentVersionName, 0); |
| 343 var currentVersion = WebInspector.VersionController.currentVersion; | 343 var currentVersion = WebInspector.VersionController.currentVersion; |
| 344 // While localStorage version exists, treat it as the main one. It'll be
erased once migrated to prefs. | 344 // While localStorage version exists, treat it as the main one. It'll be
erased once migrated to prefs. |
| 345 var oldVersion = parseInt(localStorageVersion || "0", 10) || versionSett
ing.get(); | 345 var oldVersion = parseInt(localStorageVersion || "0", 10) || versionSett
ing.get(); |
| 346 if (oldVersion === 0) { | 346 if (oldVersion === 0) { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 574 |
| 575 for (var key in window.localStorage) { | 575 for (var key in window.localStorage) { |
| 576 if (key in localSettings) | 576 if (key in localSettings) |
| 577 continue; | 577 continue; |
| 578 var value = window.localStorage[key]; | 578 var value = window.localStorage[key]; |
| 579 window.localStorage.removeItem(key); | 579 window.localStorage.removeItem(key); |
| 580 WebInspector.settings._settingsStorage[key] = value; | 580 WebInspector.settings._settingsStorage[key] = value; |
| 581 } | 581 } |
| 582 }, | 582 }, |
| 583 | 583 |
| 584 _updateVersionFrom12To13: function() |
| 585 { |
| 586 WebInspector.settings.createSetting("timelineOverviewMode", "").remove()
; |
| 587 }, |
| 588 |
| 584 /** | 589 /** |
| 585 * @param {!WebInspector.Setting} breakpointsSetting | 590 * @param {!WebInspector.Setting} breakpointsSetting |
| 586 * @param {number} maxBreakpointsCount | 591 * @param {number} maxBreakpointsCount |
| 587 */ | 592 */ |
| 588 _clearBreakpointsWhenTooMany: function(breakpointsSetting, maxBreakpointsCou
nt) | 593 _clearBreakpointsWhenTooMany: function(breakpointsSetting, maxBreakpointsCou
nt) |
| 589 { | 594 { |
| 590 // If there are too many breakpoints in a storage, it is likely due to a
recent bug that caused | 595 // If there are too many breakpoints in a storage, it is likely due to a
recent bug that caused |
| 591 // periodical breakpoints duplication leading to inspector slowness. | 596 // periodical breakpoints duplication leading to inspector slowness. |
| 592 if (breakpointsSetting.get().length > maxBreakpointsCount) | 597 if (breakpointsSetting.get().length > maxBreakpointsCount) |
| 593 breakpointsSetting.set([]); | 598 breakpointsSetting.set([]); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 609 } | 614 } |
| 610 | 615 |
| 611 /** | 616 /** |
| 612 * @param {string} settingName | 617 * @param {string} settingName |
| 613 * @return {!WebInspector.Setting} | 618 * @return {!WebInspector.Setting} |
| 614 */ | 619 */ |
| 615 WebInspector.settingForTest = function(settingName) | 620 WebInspector.settingForTest = function(settingName) |
| 616 { | 621 { |
| 617 return WebInspector.settings.settingForTest(settingName); | 622 return WebInspector.settings.settingForTest(settingName); |
| 618 } | 623 } |
| OLD | NEW |