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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 1810283003: [DevTools] Move getCollectionEntries to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-get-function-details
Patch Set: Created 4 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/platform/v8_inspector/InjectedScriptSource.js
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
index 01a001cc7f5243681427902de53b254fdb16278b..4c75155cf9d3db65bdba67f7ce040dd683dbfb09 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
@@ -301,6 +301,22 @@ InjectedScript.prototype = {
},
/**
+ * @param {!Array<!Object>} array
+ * @param {string} property
+ * @param {string} groupName
+ * @param {boolean} canAccessInspectedGlobalObject
+ * @param {boolean} forceValueType
+ * @param {boolean} generatePreview
+ */
+ wrapPropertyInArray: function(array, property, groupName, canAccessInspectedGlobalObject, forceValueType, generatePreview)
+ {
+ for (var i = 0; i < array.length; ++i) {
+ if (typeof array[i] === "object" && property in array[i])
+ array[i][property] = this.wrapObject(array[i][property], groupName, canAccessInspectedGlobalObject, forceValueType, generatePreview);
+ }
+ },
+
+ /**
* @param {*} object
* @return {!RuntimeAgent.RemoteObject}
*/
@@ -450,30 +466,6 @@ InjectedScript.prototype = {
},
/**
- * @param {string} objectId
- * @return {!Array.<!Object>|string}
- */
- getCollectionEntries: function(objectId)
- {
- var parsedObjectId = this._parseObjectId(objectId);
- var object = this._objectForId(parsedObjectId);
- if (!object || typeof object !== "object")
- return "Could not find object with given id";
- var entries = InjectedScriptHost.collectionEntries(object);
- if (!entries)
- return "Object with given id is not a collection";
- var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjectId.id);
- for (var i = 0; i < entries.length; ++i) {
- var entry = nullifyObjectProto(entries[i]);
- if ("key" in entry)
- entry.key = this._wrapObject(entry.key, objectGroupName);
- entry.value = this._wrapObject(entry.value, objectGroupName);
- entries[i] = entry;
- }
- return entries;
- },
-
- /**
* @param {!Object} object
* @param {boolean=} ownProperties
* @param {boolean=} accessorPropertiesOnly

Powered by Google App Engine
This is Rietveld 408576698