| Index: third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
|
| index efc30fd9f8e8525818f3029c82a653ca3199ec89..1c9fbef580177fd2dc6c6e396668952ebf3e21cd 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
|
| @@ -79,6 +79,19 @@ SDK.RemoteObject = class {
|
| }
|
|
|
| /**
|
| + * @param {!Protocol.Runtime.ObjectPreview} preview
|
| + * @return {number}
|
| + */
|
| + static numEntries(preview) {
|
| + if (preview.subtype !== 'map' && preview.subtype !== 'set')
|
| + return 0;
|
| + var matches = preview.description.match(/\(([0-9]+)\)/);
|
| + if (!matches)
|
| + return 0;
|
| + return parseInt(matches[1], 10);
|
| + }
|
| +
|
| + /**
|
| * @param {!Protocol.Runtime.RemoteObject|!SDK.RemoteObject|number|string|boolean|undefined|null} object
|
| * @return {!Protocol.Runtime.CallArgument}
|
| */
|
| @@ -497,7 +510,10 @@ SDK.RemoteObjectImpl = class extends SDK.RemoteObject {
|
| * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
|
| */
|
| getOwnProperties(callback) {
|
| - this.doGetProperties(true, false, false, callback);
|
| + if (Runtime.experiments.isEnabled('objectPreviews'))
|
| + this.doGetProperties(true, false, true, callback);
|
| + else
|
| + this.doGetProperties(true, false, false, callback);
|
| }
|
|
|
| /**
|
| @@ -506,7 +522,10 @@ SDK.RemoteObjectImpl = class extends SDK.RemoteObject {
|
| * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
|
| */
|
| getAllProperties(accessorPropertiesOnly, callback) {
|
| - this.doGetProperties(false, accessorPropertiesOnly, false, callback);
|
| + if (Runtime.experiments.isEnabled('objectPreviews'))
|
| + this.doGetProperties(false, accessorPropertiesOnly, true, callback);
|
| + else
|
| + this.doGetProperties(false, accessorPropertiesOnly, false, callback);
|
| }
|
|
|
| /**
|
|
|