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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js

Issue 2102453003: [DevTools] Move collectionEntries to internalProperties in protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
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 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 } 568 }
569 } 569 }
570 } else { 570 } else {
571 property.parentObject = value; 571 property.parentObject = value;
572 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(prop erty)); 572 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(prop erty));
573 } 573 }
574 } 574 }
575 if (internalProperties) { 575 if (internalProperties) {
576 for (var i = 0; i < internalProperties.length; i++) { 576 for (var i = 0; i < internalProperties.length; i++) {
577 internalProperties[i].parentObject = value; 577 internalProperties[i].parentObject = value;
578 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(inte rnalProperties[i])); 578 var treeElement = new WebInspector.ObjectPropertyTreeElement(interna lProperties[i]);
579 if (internalProperties[i].name === "[[Entries]]") {
580 treeElement.setExpandable(true);
581 treeElement.expand();
582 }
583 treeNode.appendChild(treeElement);
579 } 584 }
580 } 585 }
581 if (value && value.type === "function") { 586 if (value && value.type === "function") {
582 // Whether function has TargetFunction internal property. 587 // Whether function has TargetFunction internal property.
583 // This is a simple way to tell that the function is actually a bound fu nction (we are not told). 588 // This is a simple way to tell that the function is actually a bound fu nction (we are not told).
584 // Bound function never has inner scope and doesn't need corresponding U I node. 589 // Bound function never has inner scope and doesn't need corresponding U I node.
585 var hasTargetFunction = false; 590 var hasTargetFunction = false;
586 591
587 if (internalProperties) { 592 if (internalProperties) {
588 for (var i = 0; i < internalProperties.length; i++) { 593 for (var i = 0; i < internalProperties.length; i++) {
589 if (internalProperties[i].name === "[[TargetFunction]]") { 594 if (internalProperties[i].name === "[[TargetFunction]]") {
590 hasTargetFunction = true; 595 hasTargetFunction = true;
591 break; 596 break;
592 } 597 }
593 } 598 }
594 } 599 }
595 if (!hasTargetFunction) 600 if (!hasTargetFunction)
596 treeNode.appendChild(new WebInspector.FunctionScopeMainTreeElement(v alue)); 601 treeNode.appendChild(new WebInspector.FunctionScopeMainTreeElement(v alue));
597 } 602 }
598 if (value && value.type === "object" && (value.subtype === "map" || value.su btype === "set" || value.subtype === "iterator"))
599 treeNode.appendChild(new WebInspector.CollectionEntriesMainTreeElement(v alue));
600
601 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeN ode, emptyPlaceholder); 603 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeN ode, emptyPlaceholder);
602 } 604 }
603 605
604 /** 606 /**
605 * @param {!TreeElement} treeNode 607 * @param {!TreeElement} treeNode
606 * @param {?string=} emptyPlaceholder 608 * @param {?string=} emptyPlaceholder
607 */ 609 */
608 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded = functio n(treeNode, emptyPlaceholder) 610 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded = functio n(treeNode, emptyPlaceholder)
609 { 611 {
610 if (treeNode.childCount()) 612 if (treeNode.childCount())
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 725
724 this._remoteObject.functionDetails(didGetDetails.bind(this)); 726 this._remoteObject.functionDetails(didGetDetails.bind(this));
725 }, 727 },
726 728
727 __proto__: TreeElement.prototype 729 __proto__: TreeElement.prototype
728 } 730 }
729 731
730 /** 732 /**
731 * @constructor 733 * @constructor
732 * @extends {TreeElement} 734 * @extends {TreeElement}
733 * @param {!WebInspector.RemoteObject} remoteObject
734 */
735 WebInspector.CollectionEntriesMainTreeElement = function(remoteObject)
736 {
737 TreeElement.call(this, "<entries>", true);
738 this.toggleOnClick = true;
739 this.selectable = false;
740 this._remoteObject = remoteObject;
741 this.expand();
742 }
743
744 WebInspector.CollectionEntriesMainTreeElement.prototype = {
745 onpopulate: function()
746 {
747 /**
748 * @param {?Array.<!DebuggerAgent.CollectionEntry>} entries
749 * @this {WebInspector.CollectionEntriesMainTreeElement}
750 */
751 function didGetCollectionEntries(entries)
752 {
753 if (!entries)
754 return;
755 this.removeChildren();
756
757 var entriesLocalObject = [];
758 var runtimeModel = this._remoteObject.target().runtimeModel;
759 for (var i = 0; i < entries.length; ++i) {
760 var entry = entries[i];
761 if (entry.key) {
762 entriesLocalObject.push(new WebInspector.MapEntryLocalJSONOb ject({
763 key: runtimeModel.createRemoteObject(entry.key),
764 value: runtimeModel.createRemoteObject(entry.value)
765 }));
766 } else {
767 entriesLocalObject.push(runtimeModel.createRemoteObject(entr y.value));
768 }
769 }
770 WebInspector.ObjectPropertyTreeElement._populate(this, WebInspector. RemoteObject.fromLocalObject(entriesLocalObject), true, WebInspector.UIString("N o Entries"));
771 this.title = "<entries>[" + entriesLocalObject.length + "]";
772 }
773
774 this._remoteObject.collectionEntries(didGetCollectionEntries.bind(this)) ;
775 },
776
777 __proto__: TreeElement.prototype
778 }
779
780 /**
781 * @constructor
782 * @extends {TreeElement}
783 * @param {string} title 735 * @param {string} title
784 * @param {!WebInspector.RemoteObject} remoteObject 736 * @param {!WebInspector.RemoteObject} remoteObject
785 */ 737 */
786 WebInspector.ScopeTreeElement = function(title, remoteObject) 738 WebInspector.ScopeTreeElement = function(title, remoteObject)
787 { 739 {
788 TreeElement.call(this, title, true); 740 TreeElement.call(this, title, true);
789 this.toggleOnClick = true; 741 this.toggleOnClick = true;
790 this.selectable = false; 742 this.selectable = false;
791 this._remoteObject = remoteObject; 743 this._remoteObject = remoteObject;
792 } 744 }
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 1363
1412 result = currentName + (result ? "." + result : ""); 1364 result = currentName + (result ? "." + result : "");
1413 current = current.parent; 1365 current = current.parent;
1414 } 1366 }
1415 var treeOutlineId = treeElement.treeOutline[WebInspector.ObjectPropertie sSectionExpandController._treeOutlineId]; 1367 var treeOutlineId = treeElement.treeOutline[WebInspector.ObjectPropertie sSectionExpandController._treeOutlineId];
1416 result = treeOutlineId + (result ? ":" + result : ""); 1368 result = treeOutlineId + (result ? ":" + result : "");
1417 treeElement[WebInspector.ObjectPropertiesSectionExpandController._cached PathSymbol] = result; 1369 treeElement[WebInspector.ObjectPropertiesSectionExpandController._cached PathSymbol] = result;
1418 return result; 1370 return result;
1419 } 1371 }
1420 } 1372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698