Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1861)

Unified Diff: Source/devtools/front_end/sdk/ResourceScriptMapping.js

Issue 352953002: DevTools: properly support targets in LiveEditSupport (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/sdk/LiveEditSupport.js ('k') | Source/devtools/front_end/sdk/Target.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/ResourceScriptMapping.js
diff --git a/Source/devtools/front_end/sdk/ResourceScriptMapping.js b/Source/devtools/front_end/sdk/ResourceScriptMapping.js
index afa717cf37d669caac0f66163e489c08ec833d21..37f3db827c1b7bfa50eaa27576a26c718e63d49f 100644
--- a/Source/devtools/front_end/sdk/ResourceScriptMapping.js
+++ b/Source/devtools/front_end/sdk/ResourceScriptMapping.js
@@ -272,10 +272,11 @@ WebInspector.ResourceScriptFile = function(resourceScriptMapping, uiSourceCode,
WebInspector.ResourceScriptFile.prototype = {
/**
- * @param {function(boolean)=} callback
+ * @param {function(?string,!DebuggerAgent.SetScriptSourceError=,!WebInspector.Script=)=} callback
*/
commitLiveEdit: function(callback)
{
+ var target = this._resourceScriptMapping._target;
/**
* @param {?string} error
* @param {!DebuggerAgent.SetScriptSourceError=} errorData
@@ -283,24 +284,16 @@ WebInspector.ResourceScriptFile.prototype = {
*/
function innerCallback(error, errorData)
{
- if (error) {
- this._update();
- WebInspector.LiveEditSupport.logDetailedError(error, errorData, this._script);
- if (callback)
- callback(false);
- return;
- }
-
- this._scriptSource = source;
+ if (!error)
+ this._scriptSource = source;
this._update();
- WebInspector.LiveEditSupport.logSuccess();
if (callback)
- callback(true);
+ callback(error, errorData, this._script);
}
if (!this._script)
return;
var source = this._uiSourceCode.workingCopy();
- this._resourceScriptMapping._debuggerModel.setScriptSource(this._script.scriptId, source, innerCallback.bind(this));
+ target.debuggerModel.setScriptSource(this._script.scriptId, source, innerCallback.bind(this));
},
/**
« no previous file with comments | « Source/devtools/front_end/sdk/LiveEditSupport.js ('k') | Source/devtools/front_end/sdk/Target.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698