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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js

Issue 2747553002: [DevTools] Rework Popover API (Closed)
Patch Set: rebased Created 3 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (this._providerObject) 126 if (this._providerObject)
127 this._providerObject.dispose(); 127 this._providerObject.dispose();
128 for (var node = this.children[0]; node; node = node.traverseNextNode(true, t his, true)) { 128 for (var node = this.children[0]; node; node = node.traverseNextNode(true, t his, true)) {
129 if (node.dispose) 129 if (node.dispose)
130 node.dispose(); 130 node.dispose();
131 } 131 }
132 } 132 }
133 133
134 /** 134 /**
135 * @param {!SDK.Target} target 135 * @param {!SDK.Target} target
136 * @param {function(!SDK.RemoteObject)} callback
137 * @param {string} objectGroupName 136 * @param {string} objectGroupName
137 * @return {!Promise<!SDK.RemoteObject>}
138 */ 138 */
139 queryObjectContent(target, callback, objectGroupName) { 139 queryObjectContent(target, objectGroupName) {
140 } 140 }
141 141
142 /** 142 /**
143 * @override 143 * @override
144 */ 144 */
145 wasDetached() { 145 wasDetached() {
146 this._dataGrid.nodeWasDetached(this); 146 this._dataGrid.nodeWasDetached(this);
147 } 147 }
148 148
149 /** 149 /**
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 cell.heapSnapshotNode = this; 598 cell.heapSnapshotNode = this;
599 return cell; 599 return cell;
600 } 600 }
601 601
602 _prefixObjectCell(div) { 602 _prefixObjectCell(div) {
603 } 603 }
604 604
605 /** 605 /**
606 * @override 606 * @override
607 * @param {!SDK.Target} target 607 * @param {!SDK.Target} target
608 * @param {function(!SDK.RemoteObject)} callback
609 * @param {string} objectGroupName 608 * @param {string} objectGroupName
609 * @return {!Promise<!SDK.RemoteObject>}
610 */ 610 */
611 queryObjectContent(target, callback, objectGroupName) { 611 queryObjectContent(target, objectGroupName) {
612 var fulfill;
613 var promise = new Promise(x => fulfill = x);
614
612 /** 615 /**
613 * @param {?SDK.RemoteObject} object 616 * @param {?SDK.RemoteObject} object
614 */ 617 */
615 function onResult(object) { 618 function onResult(object) {
616 callback( 619 fulfill(
617 object || 620 object ||
618 target.runtimeModel.createRemoteObjectFromPrimitiveValue(Common.UIStri ng('Preview is not available'))); 621 target.runtimeModel.createRemoteObjectFromPrimitiveValue(Common.UIStri ng('Preview is not available')));
619 } 622 }
620 623
621 var heapProfilerModel = target.model(SDK.HeapProfilerModel); 624 var heapProfilerModel = target.model(SDK.HeapProfilerModel);
622 if (this._type === 'string') 625 if (this._type === 'string')
623 onResult(target.runtimeModel.createRemoteObjectFromPrimitiveValue(this._na me)); 626 onResult(target.runtimeModel.createRemoteObjectFromPrimitiveValue(this._na me));
624 else if (!heapProfilerModel) 627 else if (!heapProfilerModel)
625 onResult(null); 628 onResult(null);
626 else 629 else
627 heapProfilerModel.objectForSnapshotObjectId(String(this.snapshotNodeId), o bjectGroupName).then(onResult); 630 heapProfilerModel.objectForSnapshotObjectId(String(this.snapshotNodeId), o bjectGroupName).then(onResult);
631 return promise;
628 } 632 }
629 633
630 updateHasChildren() { 634 updateHasChildren() {
631 /** 635 /**
632 * @this {Profiler.HeapSnapshotGenericObjectNode} 636 * @this {Profiler.HeapSnapshotGenericObjectNode}
633 */ 637 */
634 function isEmptyCallback(isEmpty) { 638 function isEmptyCallback(isEmpty) {
635 this.setHasChildren(!isEmpty); 639 this.setHasChildren(!isEmpty);
636 } 640 }
637 this._provider().isEmpty(isEmptyCallback.bind(this)); 641 this._provider().isEmpty(isEmptyCallback.bind(this));
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 return cell; 1445 return cell;
1442 } 1446 }
1443 1447
1444 /** 1448 /**
1445 * @return {number} 1449 * @return {number}
1446 */ 1450 */
1447 allocationNodeId() { 1451 allocationNodeId() {
1448 return this._allocationNode.id; 1452 return this._allocationNode.id;
1449 } 1453 }
1450 }; 1454 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698