| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 */ | 242 */ |
| 243 mappingEntries: function(fileSystemPath) | 243 mappingEntries: function(fileSystemPath) |
| 244 { | 244 { |
| 245 return this._fileSystemMappings[fileSystemPath].slice(); | 245 return this._fileSystemMappings[fileSystemPath].slice(); |
| 246 }, | 246 }, |
| 247 | 247 |
| 248 /** | 248 /** |
| 249 * @param {string} url | 249 * @param {string} url |
| 250 * @return {boolean} | 250 * @return {boolean} |
| 251 */ | 251 */ |
| 252 hasMappingForURL: function(url) | 252 hasMappingForNetworkURL: function(url) |
| 253 { | 253 { |
| 254 return !!this._mappingEntryForURL(url); | 254 return !!this._mappingEntryForURL(url); |
| 255 }, | 255 }, |
| 256 | 256 |
| 257 /** | 257 /** |
| 258 * @param {string} url | 258 * @param {string} url |
| 259 * @return {?{fileSystemPath: string, fileURL: string}} | 259 * @return {?{fileSystemPath: string, fileURL: string}} |
| 260 */ | 260 */ |
| 261 fileForURL: function(url) | 261 fileForURL: function(url) |
| 262 { | 262 { |
| 263 var entry = this._mappingEntryForURL(url); | 263 var entry = this._mappingEntryForURL(url); |
| 264 if (!entry) | 264 if (!entry) |
| 265 return null; | 265 return null; |
| 266 var file = {}; | 266 var file = {}; |
| 267 file.fileSystemPath = entry.fileSystemPath; | 267 file.fileSystemPath = entry.fileSystemPath; |
| 268 file.fileURL = entry.fileSystemPath + entry.pathPrefix + url.substr(entr
y.urlPrefix.length); | 268 file.fileURL = entry.fileSystemPath + entry.pathPrefix + url.substr(entr
y.urlPrefix.length); |
| 269 return file; | 269 return file; |
| 270 }, | 270 }, |
| 271 | 271 |
| 272 /** | 272 /** |
| 273 * @param {string} fileSystemPath | 273 * @param {string} fileSystemPath |
| 274 * @param {string} filePath | 274 * @param {string} filePath |
| 275 * @return {string} | 275 * @return {string} |
| 276 */ | 276 */ |
| 277 urlForPath: function(fileSystemPath, filePath) | 277 networkURLForFileSystemURL: function(fileSystemPath, filePath) |
| 278 { | 278 { |
| 279 var relativePath = filePath.substring(fileSystemPath.length); | 279 var relativePath = filePath.substring(fileSystemPath.length); |
| 280 var entry = this._mappingEntryForPath(fileSystemPath, relativePath); | 280 var entry = this._mappingEntryForPath(fileSystemPath, relativePath); |
| 281 if (!entry) | 281 if (!entry) |
| 282 return ""; | 282 return ""; |
| 283 return entry.urlPrefix + relativePath.substring(entry.pathPrefix.length)
; | 283 return entry.urlPrefix + relativePath.substring(entry.pathPrefix.length)
; |
| 284 }, | 284 }, |
| 285 | 285 |
| 286 /** | 286 /** |
| 287 * @param {string} url | 287 * @param {string} url |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 this.fileSystemPath = fileSystemPath; | 336 this.fileSystemPath = fileSystemPath; |
| 337 this.urlPrefix = urlPrefix; | 337 this.urlPrefix = urlPrefix; |
| 338 this.pathPrefix = pathPrefix; | 338 this.pathPrefix = pathPrefix; |
| 339 this.configurable = configurable; | 339 this.configurable = configurable; |
| 340 } | 340 } |
| 341 | 341 |
| 342 /** | 342 /** |
| 343 * @type {!WebInspector.FileSystemMapping} | 343 * @type {!WebInspector.FileSystemMapping} |
| 344 */ | 344 */ |
| 345 WebInspector.fileSystemMapping; | 345 WebInspector.fileSystemMapping; |
| OLD | NEW |