| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 /** | 122 /** |
| 123 * @param {string} url | 123 * @param {string} url |
| 124 * @param {!WebInspector.ContentProvider} contentProvider | 124 * @param {!WebInspector.ContentProvider} contentProvider |
| 125 * @param {boolean=} isContentScript | 125 * @param {boolean=} isContentScript |
| 126 * @return {!WebInspector.UISourceCode} | 126 * @return {!WebInspector.UISourceCode} |
| 127 */ | 127 */ |
| 128 addFileForURL: function(url, contentProvider, isContentScript) | 128 addFileForURL: function(url, contentProvider, isContentScript) |
| 129 { | 129 { |
| 130 var splitURL = WebInspector.ParsedURL.splitURL(url); | 130 var splitURL = WebInspector.ParsedURL.splitURL(url); |
| 131 var projectName = splitURL[0]; | 131 var projectName = splitURL[0]; |
| 132 var parentPath = decodeURI(splitURL.slice(1, splitURL.length - 1).join("
/")); | 132 var parentPath = splitURL.slice(1, -1).join("/"); |
| 133 var name = decodeURI(splitURL[splitURL.length - 1]); | 133 try { |
| 134 parentPath = decodeURI(parentPath); |
| 135 } catch (e) { } |
| 136 var name = splitURL.peekLast() || ""; |
| 137 try { |
| 138 name = decodeURI(name); |
| 139 } catch (e) { } |
| 134 var projectDelegate = this._projectDelegate(projectName, isContentScript
|| false); | 140 var projectDelegate = this._projectDelegate(projectName, isContentScript
|| false); |
| 135 var path = projectDelegate.addFile(parentPath, name, url, contentProvide
r); | 141 var path = projectDelegate.addFile(parentPath, name, url, contentProvide
r); |
| 136 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (this._work
space.uiSourceCode(projectDelegate.id(), path)); | 142 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (this._work
space.uiSourceCode(projectDelegate.id(), path)); |
| 137 console.assert(uiSourceCode); | 143 console.assert(uiSourceCode); |
| 138 return uiSourceCode; | 144 return uiSourceCode; |
| 139 }, | 145 }, |
| 140 | 146 |
| 141 reset: function() | 147 reset: function() |
| 142 { | 148 { |
| 143 for (var projectId in this._projectDelegates) | 149 for (var projectId in this._projectDelegates) |
| 144 this._projectDelegates[projectId].reset(); | 150 this._projectDelegates[projectId].reset(); |
| 145 this._projectDelegates = {}; | 151 this._projectDelegates = {}; |
| 146 }, | 152 }, |
| 147 | 153 |
| 148 __proto__: WebInspector.Object.prototype | 154 __proto__: WebInspector.Object.prototype |
| 149 } | 155 } |
| OLD | NEW |