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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 * @return {!Workspace.UISourceCode} | 191 * @return {!Workspace.UISourceCode} |
192 */ | 192 */ |
193 addSourceMapFile(contentProvider, frameId, isContentScript, contentSize) { | 193 addSourceMapFile(contentProvider, frameId, isContentScript, contentSize) { |
194 var uiSourceCode = this._createFile(contentProvider, frameId, isContentScrip
t || false); | 194 var uiSourceCode = this._createFile(contentProvider, frameId, isContentScrip
t || false); |
195 var metadata = typeof contentSize === 'number' ? new Workspace.UISourceCodeM
etadata(null, contentSize) : null; | 195 var metadata = typeof contentSize === 'number' ? new Workspace.UISourceCodeM
etadata(null, contentSize) : null; |
196 this._addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata); | 196 this._addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata); |
197 return uiSourceCode; | 197 return uiSourceCode; |
198 } | 198 } |
199 | 199 |
200 /** | 200 /** |
| 201 * @param {string} url |
| 202 * @param {string} frameId |
| 203 * @param {boolean} isContentScript |
| 204 */ |
| 205 removeSourceMapFile(url, frameId, isContentScript) { |
| 206 this._removeFileForURL(url, frameId, isContentScript); |
| 207 } |
| 208 |
| 209 /** |
201 * @param {string} frameId | 210 * @param {string} frameId |
202 * @param {string} url | 211 * @param {string} url |
| 212 * @param {boolean} isContentScript |
203 */ | 213 */ |
204 _removeFileForURL(frameId, url) { | 214 _removeFileForURL(url, frameId, isContentScript) { |
205 var project = this._workspaceProjects.get(Bindings.NetworkProject.projectId(
this.target(), frameId, false)); | 215 var project = |
| 216 this._workspaceProjects.get(Bindings.NetworkProject.projectId(this.targe
t(), frameId, isContentScript)); |
206 if (!project) | 217 if (!project) |
207 return; | 218 return; |
208 project.removeFile(url); | 219 project.removeFile(url); |
209 } | 220 } |
210 | 221 |
211 _populate() { | 222 _populate() { |
212 /** | 223 /** |
213 * @param {!SDK.ResourceTreeFrame} frame | 224 * @param {!SDK.ResourceTreeFrame} frame |
214 * @this {Bindings.NetworkProject} | 225 * @this {Bindings.NetworkProject} |
215 */ | 226 */ |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 289 } |
279 | 290 |
280 /** | 291 /** |
281 * @param {!Common.Event} event | 292 * @param {!Common.Event} event |
282 */ | 293 */ |
283 _styleSheetRemoved(event) { | 294 _styleSheetRemoved(event) { |
284 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); | 295 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); |
285 if (header.isInline && !header.hasSourceURL && header.origin !== 'inspector'
) | 296 if (header.isInline && !header.hasSourceURL && header.origin !== 'inspector'
) |
286 return; | 297 return; |
287 | 298 |
288 this._removeFileForURL(header.frameId, header.resourceURL()); | 299 this._removeFileForURL(header.resourceURL(), header.frameId, false); |
289 } | 300 } |
290 | 301 |
291 /** | 302 /** |
292 * @param {!Common.Event} event | 303 * @param {!Common.Event} event |
293 */ | 304 */ |
294 _resourceAdded(event) { | 305 _resourceAdded(event) { |
295 var resource = /** @type {!SDK.Resource} */ (event.data); | 306 var resource = /** @type {!SDK.Resource} */ (event.data); |
296 this._addResource(resource); | 307 this._addResource(resource); |
297 } | 308 } |
298 | 309 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 return workspace.uiSourceCode(Bindings.NetworkProject.projectId(header.targe
t(), header.frameId, false), url); | 440 return workspace.uiSourceCode(Bindings.NetworkProject.projectId(header.targe
t(), header.frameId, false), url); |
430 } | 441 } |
431 }; | 442 }; |
432 | 443 |
433 Bindings.NetworkProject._networkProjectSymbol = Symbol('networkProject'); | 444 Bindings.NetworkProject._networkProjectSymbol = Symbol('networkProject'); |
434 Bindings.NetworkProject._resourceSymbol = Symbol('resource'); | 445 Bindings.NetworkProject._resourceSymbol = Symbol('resource'); |
435 Bindings.NetworkProject._scriptSymbol = Symbol('script'); | 446 Bindings.NetworkProject._scriptSymbol = Symbol('script'); |
436 Bindings.NetworkProject._styleSheetSymbol = Symbol('styleSheet'); | 447 Bindings.NetworkProject._styleSheetSymbol = Symbol('styleSheet'); |
437 Bindings.NetworkProject._targetSymbol = Symbol('target'); | 448 Bindings.NetworkProject._targetSymbol = Symbol('target'); |
438 Bindings.NetworkProject._frameSymbol = Symbol('frame'); | 449 Bindings.NetworkProject._frameSymbol = Symbol('frame'); |
OLD | NEW |