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

Unified Diff: Source/devtools/front_end/RemoteObject.js

Issue 201613004: DevTools: Add context menu option for objects to save to temp variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
Index: Source/devtools/front_end/RemoteObject.js
diff --git a/Source/devtools/front_end/RemoteObject.js b/Source/devtools/front_end/RemoteObject.js
index 3e49d096292971d32438fd6e4a5df103a8d8e4f9..880602e63fd3f4863a46758dcddd51d93a48c391 100644
--- a/Source/devtools/front_end/RemoteObject.js
+++ b/Source/devtools/front_end/RemoteObject.js
@@ -365,7 +365,7 @@ WebInspector.RemoteObjectImpl.prototype = {
return;
}
- this.doSetObjectPropertyValue(result, name, callback);
+ this.setObjectPropertyValue(name, result, callback);
if (result.objectId)
this._runtimeAgent.releaseObject(result.objectId);
@@ -373,11 +373,11 @@ WebInspector.RemoteObjectImpl.prototype = {
},
/**
- * @param {!RuntimeAgent.RemoteObject} result
* @param {string} name
+ * @param {!RuntimeAgent.RemoteObject|!WebInspector.RemoteObject} result
* @param {function(string=)} callback
*/
- doSetObjectPropertyValue: function(result, name, callback)
+ setObjectPropertyValue: function(name, result, callback)
{
// This assignment may be for a regular (data) property, and for an acccessor property (with getter/setter).
// Note the sensitive matter about accessor property: the property may be physically defined in some proto object,
@@ -389,8 +389,8 @@ WebInspector.RemoteObjectImpl.prototype = {
if (result.type === "number" && String(result.value) !== result.description)
setPropertyValueFunction = "function(a) { this[a] = " + result.description + "; }";
- delete result.description; // Optimize on traffic.
- this._runtimeAgent.callFunctionOn(this._objectId, setPropertyValueFunction, [{ value:name }, result], true, undefined, undefined, propertySetCallback.bind(this));
+ var argv = [{ value: name }, { value: result.value, objectId: result.objectId }];
+ this._runtimeAgent.callFunctionOn(this._objectId, setPropertyValueFunction, argv, true, undefined, undefined, propertySetCallback.bind(this));
/**
* @param {?Protocol.Error} error
@@ -639,11 +639,11 @@ WebInspector.ScopeRemoteObject.prototype = {
/**
* @override
- * @param {!RuntimeAgent.RemoteObject} result
* @param {string} name
+ * @param {!RuntimeAgent.RemoteObject} result
* @param {function(string=)} callback
*/
- doSetObjectPropertyValue: function(result, name, callback)
+ setObjectPropertyValue: function(name, result, callback)
{
var newValue;

Powered by Google App Engine
This is Rietveld 408576698