| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 contentURL: function() | 190 contentURL: function() |
| 191 { | 191 { |
| 192 return this._resource.contentURL(); | 192 return this._resource.contentURL(); |
| 193 }, | 193 }, |
| 194 | 194 |
| 195 /** | 195 /** |
| 196 * @return {!WebInspector.ResourceType} | 196 * @return {!WebInspector.ResourceType} |
| 197 */ | 197 */ |
| 198 contentType: function() | 198 contentType: function() |
| 199 { | 199 { |
| 200 return this._resource.contentType(); | 200 return this._resource.resourceType(); |
| 201 }, | 201 }, |
| 202 | 202 |
| 203 /** | 203 /** |
| 204 * @param {function(?string)} callback | 204 * @param {function(?string)} callback |
| 205 */ | 205 */ |
| 206 requestContent: function(callback) | 206 requestContent: function(callback) |
| 207 { | 207 { |
| 208 /** | 208 /** |
| 209 * @this {WebInspector.NetworkUISourceCodeProvider.FallbackResource} | 209 * @this {WebInspector.NetworkUISourceCodeProvider.FallbackResource} |
| 210 */ | 210 */ |
| 211 function loadFallbackContent() | 211 function loadFallbackContent() |
| 212 { | 212 { |
| 213 var scripts = this._resource.target().debuggerModel.scriptsForSource
URL(this._resource.url); | 213 var scripts = this._resource.target().debuggerModel.scriptsForSource
URL(this._resource.url); |
| 214 if (!scripts.length) { | 214 if (!scripts.length) { |
| 215 callback(null); | 215 callback(null); |
| 216 return; | 216 return; |
| 217 } | 217 } |
| 218 | 218 |
| 219 var contentProvider; | 219 var contentProvider; |
| 220 if (this._resource.type === WebInspector.resourceTypes.Document) | 220 var type = this._resource.resourceType(); |
| 221 if (type === WebInspector.resourceTypes.Document) |
| 221 contentProvider = new WebInspector.ConcatenatedScriptsContentPro
vider(scripts); | 222 contentProvider = new WebInspector.ConcatenatedScriptsContentPro
vider(scripts); |
| 222 else if (this._resource.type === WebInspector.resourceTypes.Script) | 223 else if (type === WebInspector.resourceTypes.Script) |
| 223 contentProvider = scripts[0]; | 224 contentProvider = scripts[0]; |
| 224 | 225 |
| 225 console.assert(contentProvider, "Resource content request failed. "
+ this._resource.url); | 226 console.assert(contentProvider, "Resource content request failed. "
+ this._resource.url); |
| 226 | 227 |
| 227 contentProvider.requestContent(callback); | 228 contentProvider.requestContent(callback); |
| 228 } | 229 } |
| 229 | 230 |
| 230 /** | 231 /** |
| 231 * @param {?string} content | 232 * @param {?string} content |
| 232 * @this {WebInspector.NetworkUISourceCodeProvider.FallbackResource} | 233 * @this {WebInspector.NetworkUISourceCodeProvider.FallbackResource} |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 271 } |
| 271 | 272 |
| 272 this._resource.searchInContent(query, caseSensitive, isRegex, callback); | 273 this._resource.searchInContent(query, caseSensitive, isRegex, callback); |
| 273 } | 274 } |
| 274 } | 275 } |
| 275 | 276 |
| 276 /** | 277 /** |
| 277 * @type {!WebInspector.NetworkWorkspaceBinding} | 278 * @type {!WebInspector.NetworkWorkspaceBinding} |
| 278 */ | 279 */ |
| 279 WebInspector.networkWorkspaceBinding; | 280 WebInspector.networkWorkspaceBinding; |
| OLD | NEW |