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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working CopyChanged, this._workingCopyChanged, this); | 269 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working CopyChanged, this._workingCopyChanged, this); |
270 this._update(); | 270 this._update(); |
271 } | 271 } |
272 | 272 |
273 WebInspector.ResourceScriptFile.prototype = { | 273 WebInspector.ResourceScriptFile.prototype = { |
274 /** | 274 /** |
275 * @param {function(boolean)=} callback | 275 * @param {function(boolean)=} callback |
276 */ | 276 */ |
277 commitLiveEdit: function(callback) | 277 commitLiveEdit: function(callback) |
278 { | 278 { |
279 var target = this._resourceScriptMapping._target; | |
279 /** | 280 /** |
280 * @param {?string} error | 281 * @param {?string} error |
281 * @param {!DebuggerAgent.SetScriptSourceError=} errorData | 282 * @param {!DebuggerAgent.SetScriptSourceError=} errorData |
282 * @this {WebInspector.ResourceScriptFile} | 283 * @this {WebInspector.ResourceScriptFile} |
283 */ | 284 */ |
284 function innerCallback(error, errorData) | 285 function innerCallback(error, errorData) |
285 { | 286 { |
286 if (error) { | 287 if (error) { |
287 this._update(); | 288 this._update(); |
288 WebInspector.LiveEditSupport.logDetailedError(error, errorData, this._script); | 289 WebInspector.LiveEditSupport.logDetailedError(target, error, err orData, this._script); |
289 if (callback) | 290 if (callback) |
290 callback(false); | 291 callback(false); |
291 return; | 292 return; |
292 } | 293 } |
293 | 294 |
294 this._scriptSource = source; | 295 this._scriptSource = source; |
295 this._update(); | 296 this._update(); |
296 WebInspector.LiveEditSupport.logSuccess(); | 297 WebInspector.LiveEditSupport.logSuccess(target); |
vsevik
2014/06/26 13:07:29
Let's make a message per live edit, not per target
sergeyv
2014/06/26 14:08:40
Done.
| |
297 if (callback) | 298 if (callback) |
298 callback(true); | 299 callback(true); |
299 } | 300 } |
300 if (!this._script) | 301 if (!this._script) |
301 return; | 302 return; |
302 var source = this._uiSourceCode.workingCopy(); | 303 var source = this._uiSourceCode.workingCopy(); |
303 this._resourceScriptMapping._debuggerModel.setScriptSource(this._script. scriptId, source, innerCallback.bind(this)); | 304 target.debuggerModel.setScriptSource(this._script.scriptId, source, inne rCallback.bind(this)); |
304 }, | 305 }, |
305 | 306 |
306 /** | 307 /** |
307 * @return {boolean} | 308 * @return {boolean} |
308 */ | 309 */ |
309 _isDiverged: function() | 310 _isDiverged: function() |
310 { | 311 { |
311 if (this._uiSourceCode.isDirty()) | 312 if (this._uiSourceCode.isDirty()) |
312 return true; | 313 return true; |
313 if (!this._script) | 314 if (!this._script) |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 return this._script.target(); | 408 return this._script.target(); |
408 }, | 409 }, |
409 | 410 |
410 dispose: function() | 411 dispose: function() |
411 { | 412 { |
412 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); | 413 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); |
413 }, | 414 }, |
414 | 415 |
415 __proto__: WebInspector.Object.prototype | 416 __proto__: WebInspector.Object.prototype |
416 } | 417 } |
OLD | NEW |