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

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

Issue 2605693003: DevTools: introduce object previews experiment (Closed)
Patch Set: tests Created 3 years, 12 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/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) {
dgozman 2017/01/10 22:26:10 setOrMapEntriesCount
luoe 2017/01/13 01:11:45 mapOrSetEntriesCount
+ 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'))
dgozman 2017/01/10 22:26:10 Instead of checking experiment here, we should pas
luoe 2017/01/13 01:11:45 Moved to a few callers in ObjectPropertiesSection.
+ 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'))
dgozman 2017/01/10 22:26:10 ditto
luoe 2017/01/13 01:11:46 Done.
+ this.doGetProperties(false, accessorPropertiesOnly, true, callback);
+ else
+ this.doGetProperties(false, accessorPropertiesOnly, false, callback);
}
/**

Powered by Google App Engine
This is Rietveld 408576698