| 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 = 13; | 336 WebInspector.VersionController.currentVersion = 14; |
| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 { | 567 { |
| 568 this._migrateSettingsFromLocalStorage(); | 568 this._migrateSettingsFromLocalStorage(); |
| 569 }, | 569 }, |
| 570 | 570 |
| 571 _updateVersionFrom12To13: function() | 571 _updateVersionFrom12To13: function() |
| 572 { | 572 { |
| 573 this._migrateSettingsFromLocalStorage(); | 573 this._migrateSettingsFromLocalStorage(); |
| 574 WebInspector.settings.createSetting("timelineOverviewMode", "").remove()
; | 574 WebInspector.settings.createSetting("timelineOverviewMode", "").remove()
; |
| 575 }, | 575 }, |
| 576 | 576 |
| 577 _updateVersionFrom13To14: function() |
| 578 { |
| 579 var defaultValue = { "throughput": -1, "latency": 0 }; |
| 580 WebInspector.settings.createSetting("networkConditions", defaultValue).s
et(defaultValue); |
| 581 }, |
| 582 |
| 577 _migrateSettingsFromLocalStorage: function() | 583 _migrateSettingsFromLocalStorage: function() |
| 578 { | 584 { |
| 579 // This step migrates all the settings except for the ones below into th
e browser profile. | 585 // This step migrates all the settings except for the ones below into th
e browser profile. |
| 580 var localSettings = [ "advancedSearchConfig", "breakpoints", "consoleHis
tory", "domBreakpoints", "eventListenerBreakpoints", | 586 var localSettings = [ "advancedSearchConfig", "breakpoints", "consoleHis
tory", "domBreakpoints", "eventListenerBreakpoints", |
| 581 "fileSystemMapping", "lastSelectedSourcesSidebarPa
neTab", "previouslyViewedFiles", | 587 "fileSystemMapping", "lastSelectedSourcesSidebarPa
neTab", "previouslyViewedFiles", |
| 582 "savedURLs", "watchExpressions", "workspaceExclude
dFolders", "xhrBreakpoints" ].keySet(); | 588 "savedURLs", "watchExpressions", "workspaceExclude
dFolders", "xhrBreakpoints" ].keySet(); |
| 583 if (!window.localStorage) | 589 if (!window.localStorage) |
| 584 return; | 590 return; |
| 585 | 591 |
| 586 for (var key in window.localStorage) { | 592 for (var key in window.localStorage) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 } | 626 } |
| 621 | 627 |
| 622 /** | 628 /** |
| 623 * @param {string} settingName | 629 * @param {string} settingName |
| 624 * @return {!WebInspector.Setting} | 630 * @return {!WebInspector.Setting} |
| 625 */ | 631 */ |
| 626 WebInspector.settingForTest = function(settingName) | 632 WebInspector.settingForTest = function(settingName) |
| 627 { | 633 { |
| 628 return WebInspector.settings.settingForTest(settingName); | 634 return WebInspector.settings.settingForTest(settingName); |
| 629 } | 635 } |
| OLD | NEW |