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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js
index 6ded00decb77399a3d41d5b0fa0aee01c3acdcd1..fe1ff3e18ff5fed3ee5c7f37b2927d70d0adab02 100644
--- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js
@@ -133,10 +133,10 @@ Profiler.HeapSnapshotGridNode = class extends DataGrid.DataGridNode {
/**
* @param {!SDK.Target} target
- * @param {function(!SDK.RemoteObject)} callback
* @param {string} objectGroupName
+ * @return {!Promise<!SDK.RemoteObject>}
*/
- queryObjectContent(target, callback, objectGroupName) {
+ queryObjectContent(target, objectGroupName) {
}
/**
@@ -605,15 +605,18 @@ Profiler.HeapSnapshotGenericObjectNode = class extends Profiler.HeapSnapshotGrid
/**
* @override
* @param {!SDK.Target} target
- * @param {function(!SDK.RemoteObject)} callback
* @param {string} objectGroupName
+ * @return {!Promise<!SDK.RemoteObject>}
*/
- queryObjectContent(target, callback, objectGroupName) {
+ queryObjectContent(target, objectGroupName) {
+ var fulfill;
+ var promise = new Promise(x => fulfill = x);
+
/**
* @param {?SDK.RemoteObject} object
*/
function onResult(object) {
- callback(
+ fulfill(
object ||
target.runtimeModel.createRemoteObjectFromPrimitiveValue(Common.UIString('Preview is not available')));
}
@@ -625,6 +628,7 @@ Profiler.HeapSnapshotGenericObjectNode = class extends Profiler.HeapSnapshotGrid
onResult(null);
else
heapProfilerModel.objectForSnapshotObjectId(String(this.snapshotNodeId), objectGroupName).then(onResult);
+ return promise;
}
updateHasChildren() {

Powered by Google App Engine
This is Rietveld 408576698