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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 if (!("enumerable" in descriptor)) 443 if (!("enumerable" in descriptor))
444 descriptor.enumerable = false; 444 descriptor.enumerable = false;
445 if ("symbol" in descriptor) 445 if ("symbol" in descriptor)
446 descriptor.symbol = this._wrapObject(descriptor.symbol, objectGr oupName); 446 descriptor.symbol = this._wrapObject(descriptor.symbol, objectGr oupName);
447 push(descriptors, descriptor); 447 push(descriptors, descriptor);
448 } 448 }
449 return descriptors; 449 return descriptors;
450 }, 450 },
451 451
452 /** 452 /**
453 * @param {string} objectId
454 * @return {!Array.<!Object>|string}
455 */
456 getCollectionEntries: function(objectId)
457 {
458 var parsedObjectId = this._parseObjectId(objectId);
459 var object = this._objectForId(parsedObjectId);
460 if (!object || typeof object !== "object")
461 return "Could not find object with given id";
462 var entries = InjectedScriptHost.collectionEntries(object);
463 if (!entries)
464 return "Object with given id is not a collection";
465 var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjec tId.id);
466 for (var i = 0; i < entries.length; ++i) {
467 var entry = nullifyObjectProto(entries[i]);
468 if ("key" in entry)
469 entry.key = this._wrapObject(entry.key, objectGroupName);
470 entry.value = this._wrapObject(entry.value, objectGroupName);
471 entries[i] = entry;
472 }
473 return entries;
474 },
475
476 /**
477 * @param {!Object} object 453 * @param {!Object} object
478 * @param {boolean=} ownProperties 454 * @param {boolean=} ownProperties
479 * @param {boolean=} accessorPropertiesOnly 455 * @param {boolean=} accessorPropertiesOnly
480 * @param {?Array.<string>=} propertyNamesOnly 456 * @param {?Array.<string>=} propertyNamesOnly
481 */ 457 */
482 _propertyDescriptors: function*(object, ownProperties, accessorPropertiesOnl y, propertyNamesOnly) 458 _propertyDescriptors: function*(object, ownProperties, accessorPropertiesOnl y, propertyNamesOnly)
483 { 459 {
484 var propertyProcessed = { __proto__: null }; 460 var propertyProcessed = { __proto__: null };
485 461
486 /** 462 /**
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 */ 1549 */
1574 _logEvent: function(event) 1550 _logEvent: function(event)
1575 { 1551 {
1576 inspectedGlobalObject.console.log(event.type, event); 1552 inspectedGlobalObject.console.log(event.type, event);
1577 } 1553 }
1578 } 1554 }
1579 1555
1580 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1556 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1581 return injectedScript; 1557 return injectedScript;
1582 }) 1558 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698