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 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @implements {WebInspector.ScriptSourceMapping} | 33 * @implements {WebInspector.DebuggerSourceMapping} |
34 * @param {!WebInspector.DebuggerModel} debuggerModel | 34 * @param {!WebInspector.DebuggerModel} debuggerModel |
35 * @param {!WebInspector.Workspace} workspace | 35 * @param {!WebInspector.Workspace} workspace |
36 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding | 36 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding |
37 */ | 37 */ |
38 WebInspector.ResourceScriptMapping = function(debuggerModel, workspace, debugger
WorkspaceBinding) | 38 WebInspector.ResourceScriptMapping = function(debuggerModel, workspace, debugger
WorkspaceBinding) |
39 { | 39 { |
40 this._target = debuggerModel.target(); | 40 this._target = debuggerModel.target(); |
41 this._debuggerModel = debuggerModel; | 41 this._debuggerModel = debuggerModel; |
42 this._workspace = workspace; | 42 this._workspace = workspace; |
43 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA
dded, this._uiSourceCodeAdded, this); | 43 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA
dded, this._uiSourceCodeAdded, this); |
44 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR
emoved, this._uiSourceCodeRemoved, this); | 44 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR
emoved, this._uiSourceCodeRemoved, this); |
45 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; | 45 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; |
46 this._boundURLs = new StringSet(); | 46 this._boundURLs = new StringSet(); |
47 | 47 |
48 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.ResourceScriptFil
e>} */ | 48 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.ResourceScriptFil
e>} */ |
49 this._uiSourceCodeToScriptFile = new Map(); | 49 this._uiSourceCodeToScriptFile = new Map(); |
50 | 50 |
51 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); | 51 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); |
52 } | 52 } |
53 | 53 |
54 WebInspector.ResourceScriptMapping.prototype = { | 54 WebInspector.ResourceScriptMapping.prototype = { |
55 /** | 55 /** |
56 * @param {!WebInspector.RawLocation} rawLocation | 56 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
57 * @return {?WebInspector.UILocation} | 57 * @return {?WebInspector.UILocation} |
58 */ | 58 */ |
59 rawLocationToUILocation: function(rawLocation) | 59 rawLocationToUILocation: function(rawLocation) |
60 { | 60 { |
61 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); | 61 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); |
62 var script = debuggerModelLocation.script(); | 62 var script = debuggerModelLocation.script(); |
63 var uiSourceCode = this._workspaceUISourceCodeForScript(script); | 63 var uiSourceCode = this._workspaceUISourceCodeForScript(script); |
64 if (!uiSourceCode) | 64 if (!uiSourceCode) |
65 return null; | 65 return null; |
66 var scriptFile = this.scriptFile(uiSourceCode); | 66 var scriptFile = this.scriptFile(uiSourceCode); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 */ | 431 */ |
432 addSourceMapURL: function(sourceMapURL) | 432 addSourceMapURL: function(sourceMapURL) |
433 { | 433 { |
434 if (!this._script) | 434 if (!this._script) |
435 return; | 435 return; |
436 this._script.addSourceMapURL(sourceMapURL); | 436 this._script.addSourceMapURL(sourceMapURL); |
437 }, | 437 }, |
438 | 438 |
439 __proto__: WebInspector.Object.prototype | 439 __proto__: WebInspector.Object.prototype |
440 } | 440 } |
OLD | NEW |