Commit 3e55967f authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: show specific note for queryObjects result

This modifies the 'i' note next to the queryObjects result array to
describe how objects may not be collected if they are previewed until
console.clear

Screenshot: https://imgur.com/a/q03rG

Bug: 815263
Change-Id: I872ca733fd4b3ae3f64487e6c969167c26119c62
Reviewed-on: https://chromium-review.googlesource.com/961556
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543215}
parent 375c6457
......@@ -596,9 +596,11 @@ Console.ConsoleViewMessage = class {
if (!obj.hasChildren || obj.customPreview())
return titleElement;
const note = titleElement.createChild('span', 'object-state-note');
note.classList.add('info-note');
note.title = Common.UIString('Value below was evaluated just now.');
const note = titleElement.createChild('span', 'object-state-note info-note');
if (this._message.type === SDK.ConsoleMessage.MessageType.QueryObjectResult)
note.title = ls`This value will not be collected until console is cleared.`;
else
note.title = ls`Value below was evaluated just now.`;
const section = new ObjectUI.ObjectPropertiesSection(obj, titleElement, this._linkifier);
section.element.classList.add('console-view-object-properties-section');
......
......@@ -244,8 +244,8 @@ SDK.ConsoleModel = class extends Common.Object {
*/
_queryObjectRequested(runtimeModel, event) {
const consoleMessage = new SDK.ConsoleMessage(
runtimeModel, SDK.ConsoleMessage.MessageSource.ConsoleAPI, SDK.ConsoleMessage.MessageLevel.Info, '', undefined,
undefined, undefined, undefined, [event.data.objects]);
runtimeModel, SDK.ConsoleMessage.MessageSource.ConsoleAPI, SDK.ConsoleMessage.MessageLevel.Info, '',
SDK.ConsoleMessage.MessageType.QueryObjectResult, undefined, undefined, undefined, [event.data.objects]);
this.addMessage(consoleMessage);
}
......@@ -629,7 +629,8 @@ SDK.ConsoleMessage.MessageType = {
Profile: 'profile',
ProfileEnd: 'profileEnd',
Command: 'command',
System: 'system'
System: 'system',
QueryObjectResult: 'queryObjectResult'
};
/**
......
......@@ -304,8 +304,8 @@ SDK.RuntimeModel = class extends SDK.SDKModel {
async queryObjects(prototype) {
if (!prototype.objectId)
return {error: 'Prototype should be an Object.'};
const response =
await this._agent.invoke_queryObjects({prototypeObjectId: /** @type {string} */ (prototype.objectId)});
const response = await this._agent.invoke_queryObjects(
{prototypeObjectId: /** @type {string} */ (prototype.objectId), objectGroup: 'console'});
const error = response[Protocol.Error];
if (error) {
console.error(error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment