| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 21 matching lines...) Expand all Loading... |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.Object} | 33 * @extends {WebInspector.Object} |
| 34 */ | 34 */ |
| 35 WebInspector.FileSystemMapping = function() | 35 WebInspector.FileSystemMapping = function() |
| 36 { | 36 { |
| 37 WebInspector.Object.call(this); | 37 WebInspector.Object.call(this); |
| 38 this._fileSystemMappingSetting = WebInspector.settings.createLocalSetting("f
ileSystemMapping", {}); | 38 this._fileSystemMappingSetting = WebInspector.settings.createLocalSetting("f
ileSystemMapping", {}); |
| 39 /** @type {!Object.<string, !Array.<!WebInspector.FileSystemMapping.Entry>>}
*/ | 39 /** @type {!Object.<string, !Array.<!WebInspector.FileSystemMapping.Entry>>}
*/ |
| 40 this._fileSystemMappings = {}; | 40 this._fileSystemMappings = {}; |
| 41 this._loadFromSettings(); | 41 this._loadFromSettings(); |
| 42 } | 42 }; |
| 43 | 43 |
| 44 /** @enum {symbol} */ | 44 /** @enum {symbol} */ |
| 45 WebInspector.FileSystemMapping.Events = { | 45 WebInspector.FileSystemMapping.Events = { |
| 46 FileMappingAdded: Symbol("FileMappingAdded"), | 46 FileMappingAdded: Symbol("FileMappingAdded"), |
| 47 FileMappingRemoved: Symbol("FileMappingRemoved") | 47 FileMappingRemoved: Symbol("FileMappingRemoved") |
| 48 } | 48 }; |
| 49 | 49 |
| 50 WebInspector.FileSystemMapping.prototype = { | 50 WebInspector.FileSystemMapping.prototype = { |
| 51 _loadFromSettings: function() | 51 _loadFromSettings: function() |
| 52 { | 52 { |
| 53 var savedMapping = this._fileSystemMappingSetting.get(); | 53 var savedMapping = this._fileSystemMappingSetting.get(); |
| 54 this._fileSystemMappings = {}; | 54 this._fileSystemMappings = {}; |
| 55 for (var fileSystemPath in savedMapping) { | 55 for (var fileSystemPath in savedMapping) { |
| 56 var savedFileSystemMappings = savedMapping[fileSystemPath]; | 56 var savedFileSystemMappings = savedMapping[fileSystemPath]; |
| 57 fileSystemPath = WebInspector.ParsedURL.platformPathToURL(fileSystem
Path); | 57 fileSystemPath = WebInspector.ParsedURL.platformPathToURL(fileSystem
Path); |
| 58 this._fileSystemMappings[fileSystemPath] = []; | 58 this._fileSystemMappings[fileSystemPath] = []; |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 else | 321 else |
| 322 this.addFileMapping(fileSystemPath, urlPrefix + pathPrefix, "/"); | 322 this.addFileMapping(fileSystemPath, urlPrefix + pathPrefix, "/"); |
| 323 }, | 323 }, |
| 324 | 324 |
| 325 resetForTesting: function() | 325 resetForTesting: function() |
| 326 { | 326 { |
| 327 this._fileSystemMappings = {}; | 327 this._fileSystemMappings = {}; |
| 328 }, | 328 }, |
| 329 | 329 |
| 330 __proto__: WebInspector.Object.prototype | 330 __proto__: WebInspector.Object.prototype |
| 331 } | 331 }; |
| 332 | 332 |
| 333 /** | 333 /** |
| 334 * @constructor | 334 * @constructor |
| 335 * @param {string} fileSystemPath | 335 * @param {string} fileSystemPath |
| 336 * @param {string} urlPrefix | 336 * @param {string} urlPrefix |
| 337 * @param {string} pathPrefix | 337 * @param {string} pathPrefix |
| 338 * @param {boolean} configurable | 338 * @param {boolean} configurable |
| 339 */ | 339 */ |
| 340 WebInspector.FileSystemMapping.Entry = function(fileSystemPath, urlPrefix, pathP
refix, configurable) | 340 WebInspector.FileSystemMapping.Entry = function(fileSystemPath, urlPrefix, pathP
refix, configurable) |
| 341 { | 341 { |
| 342 this.fileSystemPath = fileSystemPath; | 342 this.fileSystemPath = fileSystemPath; |
| 343 this.urlPrefix = urlPrefix; | 343 this.urlPrefix = urlPrefix; |
| 344 this.pathPrefix = pathPrefix; | 344 this.pathPrefix = pathPrefix; |
| 345 this.configurable = configurable; | 345 this.configurable = configurable; |
| 346 } | 346 }; |
| 347 | 347 |
| 348 /** | 348 /** |
| 349 * @type {!WebInspector.FileSystemMapping} | 349 * @type {!WebInspector.FileSystemMapping} |
| 350 */ | 350 */ |
| 351 WebInspector.fileSystemMapping; | 351 WebInspector.fileSystemMapping; |
| OLD | NEW |