| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 23 matching lines...) Expand all Loading... |
| 34 * @implements {WebInspector.ContentProvider} | 34 * @implements {WebInspector.ContentProvider} |
| 35 * @param {!WebInspector.Project} project | 35 * @param {!WebInspector.Project} project |
| 36 * @param {string} url | 36 * @param {string} url |
| 37 * @param {!WebInspector.ResourceType} contentType | 37 * @param {!WebInspector.ResourceType} contentType |
| 38 */ | 38 */ |
| 39 WebInspector.UISourceCode = function(project, url, contentType) | 39 WebInspector.UISourceCode = function(project, url, contentType) |
| 40 { | 40 { |
| 41 this._project = project; | 41 this._project = project; |
| 42 this._url = url; | 42 this._url = url; |
| 43 | 43 |
| 44 var pathComponents = WebInspector.ParsedURL.splitURLIntoPathComponents(url); | 44 var parsedURL = url.asParsedURL(); |
| 45 this._origin = pathComponents[0]; | 45 if (parsedURL) { |
| 46 this._parentURL = pathComponents.slice(0, -1).join("/"); | 46 this._origin = parsedURL.securityOrigin(); |
| 47 this._name = pathComponents[pathComponents.length - 1]; | 47 this._parentURL = this._origin + parsedURL.folderPathComponents; |
| 48 this._name = parsedURL.lastPathComponent; |
| 49 if (parsedURL.queryParams) |
| 50 this._name += "?" + parsedURL.queryParams; |
| 51 } else { |
| 52 this._origin = ""; |
| 53 this._parentURL = ""; |
| 54 this._name = url; |
| 55 } |
| 48 | 56 |
| 49 this._contentType = contentType; | 57 this._contentType = contentType; |
| 50 /** @type {?function(?string)} */ | 58 /** @type {?function(?string)} */ |
| 51 this._requestContentCallback = null; | 59 this._requestContentCallback = null; |
| 52 /** @type {?Promise<?string>} */ | 60 /** @type {?Promise<?string>} */ |
| 53 this._requestContentPromise = null; | 61 this._requestContentPromise = null; |
| 54 /** @type {!Map<string, !Map<number, !WebInspector.UISourceCode.LineMarker>>
} */ | 62 /** @type {!Map<string, !Map<number, !WebInspector.UISourceCode.LineMarker>>
} */ |
| 55 this._lineDecorations = new Map(); | 63 this._lineDecorations = new Map(); |
| 56 | 64 |
| 57 /** @type {!Array.<!WebInspector.Revision>} */ | 65 /** @type {!Array.<!WebInspector.Revision>} */ |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 /** | 983 /** |
| 976 * @constructor | 984 * @constructor |
| 977 * @param {?Date} modificationTime | 985 * @param {?Date} modificationTime |
| 978 * @param {?number} contentSize | 986 * @param {?number} contentSize |
| 979 */ | 987 */ |
| 980 WebInspector.UISourceCodeMetadata = function(modificationTime, contentSize) | 988 WebInspector.UISourceCodeMetadata = function(modificationTime, contentSize) |
| 981 { | 989 { |
| 982 this.modificationTime = modificationTime; | 990 this.modificationTime = modificationTime; |
| 983 this.contentSize = contentSize; | 991 this.contentSize = contentSize; |
| 984 } | 992 } |
| OLD | NEW |