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

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

Issue 2122423002: [DevTools] Remove functionDetails from protocol.json (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-generator-details-from-protocol
Patch Set: a Created 4 years, 5 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 { 274 {
275 throw new Error("DebuggerModel-less object"); 275 throw new Error("DebuggerModel-less object");
276 }, 276 },
277 277
278 /** 278 /**
279 * @return {boolean} 279 * @return {boolean}
280 */ 280 */
281 isNode: function() 281 isNode: function()
282 { 282 {
283 return false; 283 return false;
284 },
285
286 /**
287 * @param {function(?WebInspector.DebuggerModel.FunctionDetails)} callback
288 */
289 functionDetails: function(callback)
290 {
291 callback(null);
292 },
293
294 /**
295 * @return {!Promise<?WebInspector.DebuggerModel.FunctionDetails>}
296 */
297 functionDetailsPromise: function()
298 {
299 return new Promise(promiseConstructor.bind(this));
300
301 /**
302 * @param {function(?WebInspector.DebuggerModel.FunctionDetails)} succes s
303 * @this {WebInspector.RemoteObject}
304 */
305 function promiseConstructor(success)
306 {
307 this.functionDetails(success);
308 }
309 } 284 }
310 } 285 }
311 286
312 /** 287 /**
313 * @param {*} value 288 * @param {*} value
314 * @return {!WebInspector.RemoteObject} 289 * @return {!WebInspector.RemoteObject}
315 */ 290 */
316 WebInspector.RemoteObject.fromLocalObject = function(value) 291 WebInspector.RemoteObject.fromLocalObject = function(value)
317 { 292 {
318 return new WebInspector.LocalJSONObject(value); 293 return new WebInspector.LocalJSONObject(value);
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 828
854 /** 829 /**
855 * @override 830 * @override
856 * @return {boolean} 831 * @return {boolean}
857 */ 832 */
858 isNode: function() 833 isNode: function()
859 { 834 {
860 return !!this._objectId && this.type === "object" && this.subtype === "n ode"; 835 return !!this._objectId && this.type === "object" && this.subtype === "n ode";
861 }, 836 },
862 837
863 /**
864 * @override
865 * @param {function(?WebInspector.DebuggerModel.FunctionDetails)} callback
866 */
867 functionDetails: function(callback)
868 {
869 this._debuggerModel.functionDetails(this, callback);
870 },
871
872 __proto__: WebInspector.RemoteObject.prototype 838 __proto__: WebInspector.RemoteObject.prototype
873 }; 839 };
874 840
875 841
876 /** 842 /**
877 * @param {!WebInspector.RemoteObject} object 843 * @param {!WebInspector.RemoteObject} object
878 * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebIns pector.RemoteObjectProperty>)} callback 844 * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebIns pector.RemoteObjectProperty>)} callback
879 */ 845 */
880 WebInspector.RemoteObject.loadFromObjectPerProto = function(object, callback) 846 WebInspector.RemoteObject.loadFromObjectPerProto = function(object, callback)
881 { 847 {
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 return this.targetFunction().then(functionDetails.bind(this)); 1485 return this.targetFunction().then(functionDetails.bind(this));
1520 1486
1521 /** 1487 /**
1522 * @param {!WebInspector.RemoteObject} targetFunction 1488 * @param {!WebInspector.RemoteObject} targetFunction
1523 * @return {!Promise<?WebInspector.DebuggerModel.FunctionDetails>} 1489 * @return {!Promise<?WebInspector.DebuggerModel.FunctionDetails>}
1524 * @this {WebInspector.RemoteFunction} 1490 * @this {WebInspector.RemoteFunction}
1525 */ 1491 */
1526 function functionDetails(targetFunction) 1492 function functionDetails(targetFunction)
1527 { 1493 {
1528 var boundReleaseFunctionDetails = releaseTargetFunction.bind(null, t his._object !== targetFunction ? targetFunction : null); 1494 var boundReleaseFunctionDetails = releaseTargetFunction.bind(null, t his._object !== targetFunction ? targetFunction : null);
1529 return targetFunction.functionDetailsPromise().then(boundReleaseFunc tionDetails); 1495 return targetFunction.debuggerModel().functionDetailsPromise(targetF unction).then(boundReleaseFunctionDetails);
1530 } 1496 }
1531 1497
1532 /** 1498 /**
1533 * @param {?WebInspector.RemoteObject} targetFunction 1499 * @param {?WebInspector.RemoteObject} targetFunction
1534 * @param {?WebInspector.DebuggerModel.FunctionDetails} functionDetails 1500 * @param {?WebInspector.DebuggerModel.FunctionDetails} functionDetails
1535 * @return {?WebInspector.DebuggerModel.FunctionDetails} 1501 * @return {?WebInspector.DebuggerModel.FunctionDetails}
1536 */ 1502 */
1537 function releaseTargetFunction(targetFunction, functionDetails) 1503 function releaseTargetFunction(targetFunction, functionDetails)
1538 { 1504 {
1539 if (targetFunction) 1505 if (targetFunction)
1540 targetFunction.release(); 1506 targetFunction.release();
1541 return functionDetails; 1507 return functionDetails;
1542 } 1508 }
1543 }, 1509 },
1544 1510
1545 /** 1511 /**
1546 * @return {!WebInspector.RemoteObject} 1512 * @return {!WebInspector.RemoteObject}
1547 */ 1513 */
1548 object: function() 1514 object: function()
1549 { 1515 {
1550 return this._object; 1516 return this._object;
1551 } 1517 }
1552 } 1518 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698