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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js

Issue 1786243002: [DevTools] Move restartFrame and setCallFrameVariableValue to V8DebuggerAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dgozman-patch
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 return; 1041 return;
1042 } 1042 }
1043 1043
1044 /** 1044 /**
1045 * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties 1045 * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
1046 * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperti es 1046 * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperti es
1047 * @this {WebInspector.ScopeRemoteObject} 1047 * @this {WebInspector.ScopeRemoteObject}
1048 */ 1048 */
1049 function wrappedCallback(properties, internalProperties) 1049 function wrappedCallback(properties, internalProperties)
1050 { 1050 {
1051 if (this._scopeRef && Array.isArray(properties)) 1051 if (this._scopeRef && Array.isArray(properties)) {
1052 this._savedScopeProperties = properties.slice(); 1052 this._savedScopeProperties = properties.slice();
1053 if (!this._scopeRef.callFrameId) {
1054 for (var property of this._savedScopeProperties)
1055 property.writable = false;
1056 }
1057 }
1053 callback(properties, internalProperties); 1058 callback(properties, internalProperties);
1054 } 1059 }
1055 1060
1056 // Scope objects always fetch preview. 1061 // Scope objects always fetch preview.
1057 generatePreview = true; 1062 generatePreview = true;
1058 1063
1059 WebInspector.RemoteObjectImpl.prototype.doGetProperties.call(this, ownPr operties, accessorPropertiesOnly, generatePreview, wrappedCallback.bind(this)); 1064 WebInspector.RemoteObjectImpl.prototype.doGetProperties.call(this, ownPr operties, accessorPropertiesOnly, generatePreview, wrappedCallback.bind(this));
1060 }, 1065 },
1061 1066
1062 /** 1067 /**
1063 * @override 1068 * @override
1064 * @param {!RuntimeAgent.RemoteObject} result 1069 * @param {!RuntimeAgent.RemoteObject} result
1065 * @param {!RuntimeAgent.CallArgument} argumentName 1070 * @param {!RuntimeAgent.CallArgument} argumentName
1066 * @param {function(string=)} callback 1071 * @param {function(string=)} callback
1067 */ 1072 */
1068 doSetObjectPropertyValue: function(result, argumentName, callback) 1073 doSetObjectPropertyValue: function(result, argumentName, callback)
1069 { 1074 {
1070 var name = /** @type {string} */ (argumentName.value); 1075 var name = /** @type {string} */ (argumentName.value);
1071 this._debuggerModel.setVariableValue(this._scopeRef.number, name, WebIns pector.RemoteObject.toCallArgument(result), this._scopeRef.callFrameId, this._sc opeRef.functionId, setVariableValueCallback.bind(this)); 1076 this._debuggerModel.setVariableValue(this._scopeRef.number, name, WebIns pector.RemoteObject.toCallArgument(result), this._scopeRef.callFrameId, setVaria bleValueCallback.bind(this));
1072 1077
1073 /** 1078 /**
1074 * @param {string=} error 1079 * @param {string=} error
1075 * @this {WebInspector.ScopeRemoteObject} 1080 * @this {WebInspector.ScopeRemoteObject}
1076 */ 1081 */
1077 function setVariableValueCallback(error) 1082 function setVariableValueCallback(error)
1078 { 1083 {
1079 if (error) { 1084 if (error) {
1080 callback(error); 1085 callback(error);
1081 return; 1086 return;
1082 } 1087 }
1083 if (this._savedScopeProperties) { 1088 if (this._savedScopeProperties) {
1084 for (var i = 0; i < this._savedScopeProperties.length; i++) { 1089 for (var i = 0; i < this._savedScopeProperties.length; i++) {
1085 if (this._savedScopeProperties[i].name === name) 1090 if (this._savedScopeProperties[i].name === name)
1086 this._savedScopeProperties[i].value = this._target.runti meModel.createRemoteObject(result); 1091 this._savedScopeProperties[i].value = this._target.runti meModel.createRemoteObject(result);
1087 } 1092 }
1088 } 1093 }
1089 callback(); 1094 callback();
1090 } 1095 }
1091 }, 1096 },
1092 1097
1093 __proto__: WebInspector.RemoteObjectImpl.prototype 1098 __proto__: WebInspector.RemoteObjectImpl.prototype
1094 }; 1099 };
1095 1100
1096 /** 1101 /**
1097 * Either callFrameId or functionId (exactly one) must be defined.
1098 * @constructor 1102 * @constructor
1099 * @param {number} number 1103 * @param {number} number
1100 * @param {string=} callFrameId 1104 * @param {string=} callFrameId
1101 * @param {string=} functionId
1102 */ 1105 */
1103 WebInspector.ScopeRef = function(number, callFrameId, functionId) 1106 WebInspector.ScopeRef = function(number, callFrameId)
1104 { 1107 {
1105 this.number = number; 1108 this.number = number;
1106 this.callFrameId = callFrameId; 1109 this.callFrameId = callFrameId;
1107 this.functionId = functionId;
1108 } 1110 }
1109 1111
1110 /** 1112 /**
1111 * @constructor 1113 * @constructor
1112 * @param {string} name 1114 * @param {string} name
1113 * @param {?WebInspector.RemoteObject} value 1115 * @param {?WebInspector.RemoteObject} value
1114 * @param {boolean=} enumerable 1116 * @param {boolean=} enumerable
1115 * @param {boolean=} writable 1117 * @param {boolean=} writable
1116 * @param {boolean=} isOwn 1118 * @param {boolean=} isOwn
1117 * @param {boolean=} wasThrown 1119 * @param {boolean=} wasThrown
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 { 1629 {
1628 if (!this._cachedDescription) { 1630 if (!this._cachedDescription) {
1629 var children = this._children(); 1631 var children = this._children();
1630 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}"; 1632 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}";
1631 } 1633 }
1632 return this._cachedDescription; 1634 return this._cachedDescription;
1633 }, 1635 },
1634 1636
1635 __proto__: WebInspector.LocalJSONObject.prototype 1637 __proto__: WebInspector.LocalJSONObject.prototype
1636 } 1638 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js ('k') | third_party/WebKit/Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698