| 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 * @extends {WebInspector.TargetAware} | 33 * @extends {WebInspector.SDKObject} |
| 34 * @param {!WebInspector.Target} target | 34 * @param {!WebInspector.Target} target |
| 35 * @param {!WebInspector.Workspace} workspace | 35 * @param {!WebInspector.Workspace} workspace |
| 36 */ | 36 */ |
| 37 WebInspector.LiveEditSupport = function(target, workspace) | 37 WebInspector.LiveEditSupport = function(target, workspace) |
| 38 { | 38 { |
| 39 WebInspector.TargetAware.call(this, target); | 39 WebInspector.SDKObject.call(this, target); |
| 40 this._workspace = workspace; | 40 this._workspace = workspace; |
| 41 this._projectId = "liveedit:" + target.id(); | 41 this._projectId = "liveedit:" + target.id(); |
| 42 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(workspace,
this._projectId, WebInspector.projectTypes.LiveEdit); | 42 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(workspace,
this._projectId, WebInspector.projectTypes.LiveEdit); |
| 43 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Glob
alObjectCleared, this._debuggerReset, this); | 43 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Glob
alObjectCleared, this._debuggerReset, this); |
| 44 this._debuggerReset(); | 44 this._debuggerReset(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 WebInspector.LiveEditSupport.prototype = { | 47 WebInspector.LiveEditSupport.prototype = { |
| 48 /** | 48 /** |
| 49 * @param {!WebInspector.UISourceCode} uiSourceCode | 49 * @param {!WebInspector.UISourceCode} uiSourceCode |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 { | 99 { |
| 100 if (error) { | 100 if (error) { |
| 101 var script = this.target().debuggerModel.scriptForId(scriptId); | 101 var script = this.target().debuggerModel.scriptForId(scriptId); |
| 102 WebInspector.LiveEditSupport.logDetailedError(error, errorData,
script); | 102 WebInspector.LiveEditSupport.logDetailedError(error, errorData,
script); |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 WebInspector.LiveEditSupport.logSuccess(); | 105 WebInspector.LiveEditSupport.logSuccess(); |
| 106 } | 106 } |
| 107 }, | 107 }, |
| 108 | 108 |
| 109 __proto__: WebInspector.TargetAware.prototype | 109 __proto__: WebInspector.SDKObject.prototype |
| 110 } | 110 } |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * @param {!WebInspector.UISourceCode} uiSourceCode | 113 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 114 * @return {?WebInspector.LiveEditSupport} | 114 * @return {?WebInspector.LiveEditSupport} |
| 115 */ | 115 */ |
| 116 WebInspector.LiveEditSupport.liveEditSupportForUISourceCode = function(uiSourceC
ode) | 116 WebInspector.LiveEditSupport.liveEditSupportForUISourceCode = function(uiSourceC
ode) |
| 117 { | 117 { |
| 118 var projectId = uiSourceCode.project().id(); | 118 var projectId = uiSourceCode.project().id(); |
| 119 var target; | 119 var target; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 147 WebInspector.messageSink.addErrorMessage(message); | 147 WebInspector.messageSink.addErrorMessage(message); |
| 148 } else { | 148 } else { |
| 149 WebInspector.messageSink.addMessage(WebInspector.UIString("Unknown LiveE
dit error: %s; %s", JSON.stringify(errorData), error), warningLevel); | 149 WebInspector.messageSink.addMessage(WebInspector.UIString("Unknown LiveE
dit error: %s; %s", JSON.stringify(errorData), error), warningLevel); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 WebInspector.LiveEditSupport.logSuccess = function() | 153 WebInspector.LiveEditSupport.logSuccess = function() |
| 154 { | 154 { |
| 155 WebInspector.messageSink.addMessage(WebInspector.UIString("Recompilation and
update succeeded.")); | 155 WebInspector.messageSink.addMessage(WebInspector.UIString("Recompilation and
update succeeded.")); |
| 156 } | 156 } |
| OLD | NEW |