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 22 matching lines...) Expand all Loading... |
33 * @param {!WebInspector.DebuggerModel} debuggerModel | 33 * @param {!WebInspector.DebuggerModel} debuggerModel |
34 * @param {!WebInspector.Workspace} workspace | 34 * @param {!WebInspector.Workspace} workspace |
35 * @param {!WebInspector.NetworkWorkspaceBinding} networkWorkspaceBinding | 35 * @param {!WebInspector.NetworkWorkspaceBinding} networkWorkspaceBinding |
36 */ | 36 */ |
37 WebInspector.DebuggerScriptMapping = function(debuggerModel, workspace, networkW
orkspaceBinding) | 37 WebInspector.DebuggerScriptMapping = function(debuggerModel, workspace, networkW
orkspaceBinding) |
38 { | 38 { |
39 this._defaultMapping = new WebInspector.DefaultScriptMapping(debuggerModel,
workspace); | 39 this._defaultMapping = new WebInspector.DefaultScriptMapping(debuggerModel,
workspace); |
40 this._resourceMapping = new WebInspector.ResourceScriptMapping(debuggerModel
, workspace); | 40 this._resourceMapping = new WebInspector.ResourceScriptMapping(debuggerModel
, workspace); |
41 this._compilerMapping = new WebInspector.CompilerScriptMapping(debuggerModel
, workspace, networkWorkspaceBinding); | 41 this._compilerMapping = new WebInspector.CompilerScriptMapping(debuggerModel
, workspace, networkWorkspaceBinding); |
42 | 42 |
| 43 /** @type {!WebInspector.LiveEditSupport} */ |
| 44 this._liveEditSupport = new WebInspector.LiveEditSupport(debuggerModel.targe
t(), WebInspector.workspace); |
| 45 |
43 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScrip
tSource, this._parsedScriptSource, this); | 46 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScrip
tSource, this._parsedScriptSource, this); |
44 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToPar
seScriptSource, this._parsedScriptSource, this); | 47 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToPar
seScriptSource, this._parsedScriptSource, this); |
45 } | 48 } |
46 | 49 |
47 WebInspector.DebuggerScriptMapping.prototype = { | 50 WebInspector.DebuggerScriptMapping.prototype = { |
48 /** | 51 /** |
49 * @param {!WebInspector.Event} event | 52 * @param {!WebInspector.Event} event |
50 */ | 53 */ |
51 _parsedScriptSource: function(event) | 54 _parsedScriptSource: function(event) |
52 { | 55 { |
53 var script = /** @type {!WebInspector.Script} */ (event.data); | 56 var script = /** @type {!WebInspector.Script} */ (event.data); |
54 this._defaultMapping.addScript(script); | 57 this._defaultMapping.addScript(script); |
55 | 58 |
56 if (script.isSnippet()) { | 59 if (script.isSnippet()) { |
57 WebInspector.scriptSnippetModel.addScript(script); | 60 WebInspector.scriptSnippetModel.addScript(script); |
58 return; | 61 return; |
59 } | 62 } |
60 | 63 |
61 this._resourceMapping.addScript(script); | 64 this._resourceMapping.addScript(script); |
62 | 65 |
63 if (WebInspector.settings.jsSourceMapsEnabled.get()) | 66 if (WebInspector.settings.jsSourceMapsEnabled.get()) |
64 this._compilerMapping.addScript(script); | 67 this._compilerMapping.addScript(script); |
65 }, | 68 }, |
66 | 69 |
67 dispose: function() | 70 dispose: function() |
68 { | 71 { |
69 this._compilerMapping.dispose(); | 72 this._compilerMapping.dispose(); |
70 this._resourceMapping.dispose(); | 73 this._resourceMapping.dispose(); |
71 this._defaultMapping.dispose(); | 74 this._defaultMapping.dispose(); |
| 75 }, |
| 76 |
| 77 /** |
| 78 * @return {!WebInspector.LiveEditSupport} |
| 79 */ |
| 80 liveEditSupport: function() |
| 81 { |
| 82 return this._liveEditSupport; |
72 } | 83 } |
73 } | 84 } |
OLD | NEW |