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

Side by Side Diff: chrome_linux/resources/inspector/HeapSnapshotWorker.js

Issue 42163002: Roll Linux reference build to official build 31.0.1650.34 (trunk r224845, branch r230433) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/reference_builds/
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 WebInspector={};WebInspector.UIString=function(s){return s;};WebInspector.HeapSn apshotArraySlice=function(array,start,end) 1 WebInspector={};WebInspector.UIString=function(s){return s;};WebInspector.Alloca tionProfile=function(profile)
2 {this._strings=profile.strings;this._nextNodeId=1;this._idToFunctionInfo={};this ._idToNode={};this._collapsedTopNodeIdToFunctionInfo={};this._traceTops=null;thi s._buildAllocationFunctionInfos(profile.trace_function_infos);this._traceTree=th is._buildInvertedAllocationTree(profile.trace_tree);}
3 WebInspector.AllocationProfile.prototype={_buildAllocationFunctionInfos:function (rawInfos)
4 {var strings=this._strings;var functionIdOffset=0;var functionNameOffset=1;var s criptNameOffset=2;var functionInfoFieldCount=3;var map=this._idToFunctionInfo;ma p[0]=new WebInspector.FunctionAllocationInfo("(root)","<unknown>");var infoLengt h=rawInfos.length;for(var i=0;i<infoLength;i+=functionInfoFieldCount){map[rawInf os[i+functionIdOffset]]=new WebInspector.FunctionAllocationInfo(strings[rawInfos [i+functionNameOffset]],strings[rawInfos[i+scriptNameOffset]]);}},_buildInverted AllocationTree:function(traceTreeRaw)
5 {var idToFunctionInfo=this._idToFunctionInfo;var nodeIdOffset=0;var functionIdOf fset=1;var allocationCountOffset=2;var allocationSizeOffset=3;var childrenOffset =4;var nodeFieldCount=5;function traverseNode(rawNodeArray,nodeOffset,parent)
6 {var functionInfo=idToFunctionInfo[rawNodeArray[nodeOffset+functionIdOffset]];va r result=new WebInspector.AllocationTraceNode(rawNodeArray[nodeOffset+nodeIdOffs et],functionInfo,rawNodeArray[nodeOffset+allocationCountOffset],rawNodeArray[nod eOffset+allocationSizeOffset],parent);functionInfo.addTraceTopNode(result);var r awChildren=rawNodeArray[nodeOffset+childrenOffset];for(var i=0;i<rawChildren.len gth;i+=nodeFieldCount){result.children.push(traverseNode(rawChildren,i,result)); }
7 return result;}
8 return traverseNode(traceTreeRaw,0,null);},serializeTraceTops:function()
9 {if(this._traceTops)
10 return this._traceTops;var result=this._traceTops=[];var idToFunctionInfo=this._ idToFunctionInfo;for(var id in idToFunctionInfo){var info=idToFunctionInfo[id];i f(info.totalCount===0)
11 continue;var nodeId=this._nextNodeId++;result.push(this._serializeNode(nodeId,in fo.functionName,info.totalCount,info.totalSize,true));this._collapsedTopNodeIdTo FunctionInfo[nodeId]=info;}
12 return result;},serializeCallers:function(nodeId)
13 {var node=this._idToNode[nodeId];if(!node){var functionInfo=this._collapsedTopNo deIdToFunctionInfo[nodeId];node=functionInfo.tracesWithThisTop();delete this._co llapsedTopNodeIdToFunctionInfo[nodeId];this._idToNode[nodeId]=node;}
14 var result=[];var callers=node.callers();for(var i=0;i<callers.length;i++){var c allerNode=callers[i];var callerId=this._nextNodeId++;this._idToNode[callerId]=ca llerNode;result.push(this._serializeNode(callerId,callerNode.functionInfo.functi onName,callerNode.allocationCount,callerNode.allocationSize,callerNode.hasCaller s()));}
15 return result;},_serializeNode:function(nodeId,functionName,count,size,hasChildr en)
16 {return{id:nodeId,name:functionName,count:count,size:size,hasChildren:hasChildre n};}}
17 WebInspector.AllocationTraceNode=function(id,functionInfo,count,size,parent)
18 {this.id=id;this.functionInfo=functionInfo;this.allocationCount=count;this.alloc ationSize=size;this.parent=parent;this.children=[];}
19 WebInspector.AllocationBackTraceNode=function(functionInfo)
20 {this.functionInfo=functionInfo;this.allocationCount=0;this.allocationSize=0;thi s._callers=[];}
21 WebInspector.AllocationBackTraceNode.prototype={addCaller:function(traceNode)
22 {var functionInfo=traceNode.functionInfo;var result;for(var i=0;i<this._callers. length;i++){var caller=this._callers[i];if(caller.functionInfo===functionInfo){r esult=caller;break;}}
23 if(!result){result=new WebInspector.AllocationBackTraceNode(functionInfo);this._ callers.push(result);}
24 return result;},callers:function()
25 {return this._callers;},hasCallers:function()
26 {return this._callers.length>0;}}
27 WebInspector.FunctionAllocationInfo=function(functionName,scriptName)
28 {this.functionName=functionName;this.scriptName=scriptName;this.totalCount=0;thi s.totalSize=0;this._traceTops=[];}
29 WebInspector.FunctionAllocationInfo.prototype={addTraceTopNode:function(node)
30 {if(node.allocationCount===0)
31 return;this._traceTops.push(node);this.totalCount+=node.allocationCount;this.tot alSize+=node.allocationSize;},tracesWithThisTop:function()
32 {if(!this._traceTops.length)
33 return null;if(!this._backTraceTree)
34 this._buildAllocationTraceTree();return this._backTraceTree;},_buildAllocationTr aceTree:function()
35 {this._backTraceTree=new WebInspector.AllocationBackTraceNode(this._traceTops[0] .functionInfo);for(var i=0;i<this._traceTops.length;i++){var node=this._traceTop s[i];var backTraceNode=this._backTraceTree;var count=node.allocationCount;var si ze=node.allocationSize;while(true){backTraceNode.allocationCount+=count;backTrac eNode.allocationSize+=size;node=node.parent;if(node===null){break;}
36 backTraceNode=backTraceNode.addCaller(node);}}}};WebInspector.HeapSnapshotArrayS lice=function(array,start,end)
2 {this._array=array;this._start=start;this.length=end-start;} 37 {this._array=array;this._start=start;this.length=end-start;}
3 WebInspector.HeapSnapshotArraySlice.prototype={item:function(index) 38 WebInspector.HeapSnapshotArraySlice.prototype={item:function(index)
4 {return this._array[this._start+index];},slice:function(start,end) 39 {return this._array[this._start+index];},slice:function(start,end)
5 {if(typeof end==="undefined") 40 {if(typeof end==="undefined")
6 end=this.length;return this._array.subarray(this._start+start,this._start+end);} } 41 end=this.length;return this._array.subarray(this._start+start,this._start+end);} }
7 WebInspector.HeapSnapshotEdge=function(snapshot,edges,edgeIndex) 42 WebInspector.HeapSnapshotEdge=function(snapshot,edges,edgeIndex)
8 {this._snapshot=snapshot;this._edges=edges;this.edgeIndex=edgeIndex||0;} 43 {this._snapshot=snapshot;this._edges=edges;this.edgeIndex=edgeIndex||0;}
9 WebInspector.HeapSnapshotEdge.prototype={clone:function() 44 WebInspector.HeapSnapshotEdge.prototype={clone:function()
10 {return new WebInspector.HeapSnapshotEdge(this._snapshot,this._edges,this.edgeIn dex);},hasStringName:function() 45 {return new WebInspector.HeapSnapshotEdge(this._snapshot,this._edges,this.edgeIn dex);},hasStringName:function()
11 {throw new Error("Not implemented");},name:function() 46 {throw new Error("Not implemented");},name:function()
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 {return this.nodeIndex+this._snapshot._nodeFieldCount;},_type:function() 110 {return this.nodeIndex+this._snapshot._nodeFieldCount;},_type:function()
76 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod eTypeOffset];}};WebInspector.HeapSnapshotNodeIterator=function(node) 111 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod eTypeOffset];}};WebInspector.HeapSnapshotNodeIterator=function(node)
77 {this.node=node;this._nodesLength=node._snapshot._nodes.length;} 112 {this.node=node;this._nodesLength=node._snapshot._nodes.length;}
78 WebInspector.HeapSnapshotNodeIterator.prototype={rewind:function() 113 WebInspector.HeapSnapshotNodeIterator.prototype={rewind:function()
79 {this.node.nodeIndex=this.node._firstNodeIndex;},hasNext:function() 114 {this.node.nodeIndex=this.node._firstNodeIndex;},hasNext:function()
80 {return this.node.nodeIndex<this._nodesLength;},index:function() 115 {return this.node.nodeIndex<this._nodesLength;},index:function()
81 {return this.node.nodeIndex;},setIndex:function(newIndex) 116 {return this.node.nodeIndex;},setIndex:function(newIndex)
82 {this.node.nodeIndex=newIndex;},item:function() 117 {this.node.nodeIndex=newIndex;},item:function()
83 {return this.node;},next:function() 118 {return this.node;},next:function()
84 {this.node.nodeIndex=this.node._nextNodeIndex();}} 119 {this.node.nodeIndex=this.node._nextNodeIndex();}}
85 WebInspector.HeapSnapshot=function(profile) 120 WebInspector.HeapSnapshotProgress=function(dispatcher)
86 {this.uid=profile.snapshot.uid;this._nodes=profile.nodes;this._containmentEdges= profile.edges;this._metaNode=profile.snapshot.meta;this._strings=profile.strings ;this._noDistance=-5;this._rootNodeIndex=0;if(profile.snapshot.root_index) 121 {this._dispatcher=dispatcher;}
87 this._rootNodeIndex=profile.snapshot.root_index;this._snapshotDiffs={};this._agg regatesForDiff=null;this._init();} 122 WebInspector.HeapSnapshotProgress.Event={Update:"ProgressUpdate"};WebInspector.H eapSnapshotProgress.prototype={updateStatus:function(status)
88 function HeapSnapshotMetainfo() 123 {this._sendUpdateEvent(WebInspector.UIString(status));},updateProgress:function( title,value,total)
124 {var percentValue=((total?(value/total):0)*100).toFixed(0);this._sendUpdateEvent (WebInspector.UIString(title,percentValue));},_sendUpdateEvent:function(text)
125 {if(this._dispatcher)
126 this._dispatcher.sendEvent(WebInspector.HeapSnapshotProgress.Event.Update,text); }}
127 WebInspector.HeapSnapshot=function(profile,progress)
128 {this.uid=profile.snapshot.uid;this._nodes=profile.nodes;this._containmentEdges= profile.edges;this._metaNode=profile.snapshot.meta;this._strings=profile.strings ;this._progress=progress;this._noDistance=-5;this._rootNodeIndex=0;if(profile.sn apshot.root_index)
129 this._rootNodeIndex=profile.snapshot.root_index;this._snapshotDiffs={};this._agg regatesForDiff=null;this._init();if(WebInspector.HeapSnapshot.enableAllocationPr ofiler){this._progress.updateStatus("Buiding allocation statistics\u2026");this. _allocationProfile=new WebInspector.AllocationProfile(profile);this._progress.up dateStatus("Done");}}
130 WebInspector.HeapSnapshot.enableAllocationProfiler=false;function HeapSnapshotMe tainfo()
89 {this.node_fields=[];this.node_types=[];this.edge_fields=[];this.edge_types=[];t his.type_strings={};this.fields=[];this.types=[];} 131 {this.node_fields=[];this.node_types=[];this.edge_fields=[];this.edge_types=[];t his.type_strings={};this.fields=[];this.types=[];}
90 function HeapSnapshotHeader() 132 function HeapSnapshotHeader()
91 {this.title="";this.uid=0;this.meta=new HeapSnapshotMetainfo();this.node_count=0 ;this.edge_count=0;} 133 {this.title="";this.uid=0;this.meta=new HeapSnapshotMetainfo();this.node_count=0 ;this.edge_count=0;}
92 WebInspector.HeapSnapshot.prototype={_init:function() 134 WebInspector.HeapSnapshot.prototype={_init:function()
93 {var meta=this._metaNode;this._nodeTypeOffset=meta.node_fields.indexOf("type");t his._nodeNameOffset=meta.node_fields.indexOf("name");this._nodeIdOffset=meta.nod e_fields.indexOf("id");this._nodeSelfSizeOffset=meta.node_fields.indexOf("self_s ize");this._nodeEdgeCountOffset=meta.node_fields.indexOf("edge_count");this._nod eFieldCount=meta.node_fields.length;this._nodeTypes=meta.node_types[this._nodeTy peOffset];this._nodeHiddenType=this._nodeTypes.indexOf("hidden");this._nodeObjec tType=this._nodeTypes.indexOf("object");this._nodeNativeType=this._nodeTypes.ind exOf("native");this._nodeCodeType=this._nodeTypes.indexOf("code");this._nodeSynt heticType=this._nodeTypes.indexOf("synthetic");this._edgeFieldsCount=meta.edge_f ields.length;this._edgeTypeOffset=meta.edge_fields.indexOf("type");this._edgeNam eOffset=meta.edge_fields.indexOf("name_or_index");this._edgeToNodeOffset=meta.ed ge_fields.indexOf("to_node");this._edgeTypes=meta.edge_types[this._edgeTypeOffse t];this._edgeTypes.push("invisible");this._edgeElementType=this._edgeTypes.index Of("element");this._edgeHiddenType=this._edgeTypes.indexOf("hidden");this._edgeI nternalType=this._edgeTypes.indexOf("internal");this._edgeShortcutType=this._edg eTypes.indexOf("shortcut");this._edgeWeakType=this._edgeTypes.indexOf("weak");th is._edgeInvisibleType=this._edgeTypes.indexOf("invisible");this.nodeCount=this._ nodes.length/this._nodeFieldCount;this._edgeCount=this._containmentEdges.length/ this._edgeFieldsCount;this._buildEdgeIndexes();this._markInvisibleEdges();this._ buildRetainers();this._calculateFlags();this._calculateDistances();var result=th is._buildPostOrderIndex();this._dominatorsTree=this._buildDominatorTree(result.p ostOrderIndex2NodeOrdinal,result.nodeOrdinal2PostOrderIndex);this._calculateReta inedSizes(result.postOrderIndex2NodeOrdinal);this._buildDominatedNodes();},_buil dEdgeIndexes:function() 135 {var meta=this._metaNode;this._nodeTypeOffset=meta.node_fields.indexOf("type");t his._nodeNameOffset=meta.node_fields.indexOf("name");this._nodeIdOffset=meta.nod e_fields.indexOf("id");this._nodeSelfSizeOffset=meta.node_fields.indexOf("self_s ize");this._nodeEdgeCountOffset=meta.node_fields.indexOf("edge_count");this._nod eFieldCount=meta.node_fields.length;this._nodeTypes=meta.node_types[this._nodeTy peOffset];this._nodeHiddenType=this._nodeTypes.indexOf("hidden");this._nodeObjec tType=this._nodeTypes.indexOf("object");this._nodeNativeType=this._nodeTypes.ind exOf("native");this._nodeConsStringType=this._nodeTypes.indexOf("concatenated st ring");this._nodeSlicedStringType=this._nodeTypes.indexOf("sliced string");this. _nodeCodeType=this._nodeTypes.indexOf("code");this._nodeSyntheticType=this._node Types.indexOf("synthetic");this._edgeFieldsCount=meta.edge_fields.length;this._e dgeTypeOffset=meta.edge_fields.indexOf("type");this._edgeNameOffset=meta.edge_fi elds.indexOf("name_or_index");this._edgeToNodeOffset=meta.edge_fields.indexOf("t o_node");this._edgeTypes=meta.edge_types[this._edgeTypeOffset];this._edgeTypes.p ush("invisible");this._edgeElementType=this._edgeTypes.indexOf("element");this._ edgeHiddenType=this._edgeTypes.indexOf("hidden");this._edgeInternalType=this._ed geTypes.indexOf("internal");this._edgeShortcutType=this._edgeTypes.indexOf("shor tcut");this._edgeWeakType=this._edgeTypes.indexOf("weak");this._edgeInvisibleTyp e=this._edgeTypes.indexOf("invisible");this.nodeCount=this._nodes.length/this._n odeFieldCount;this._edgeCount=this._containmentEdges.length/this._edgeFieldsCoun t;this._progress.updateStatus("Building edge indexes\u2026");this._buildEdgeInde xes();this._progress.updateStatus("Marking invisible edges\u2026");this._markInv isibleEdges();this._progress.updateStatus("Building retainers\u2026");this._buil dRetainers();this._progress.updateStatus("Calculating node flags\u2026");this._c alculateFlags();this._progress.updateStatus("Calculating distances\u2026");this. _calculateDistances();this._progress.updateStatus("Building postorder index\u202 6");var result=this._buildPostOrderIndex();this._progress.updateStatus("Building dominator tree\u2026");this._dominatorsTree=this._buildDominatorTree(result.pos tOrderIndex2NodeOrdinal,result.nodeOrdinal2PostOrderIndex);this._progress.update Status("Calculating retained sizes\u2026");this._calculateRetainedSizes(result.p ostOrderIndex2NodeOrdinal);this._progress.updateStatus("Buiding dominated nodes\ u2026");this._buildDominatedNodes();this._progress.updateStatus("Finished proces sing.");},_buildEdgeIndexes:function()
94 {var nodes=this._nodes;var nodeCount=this.nodeCount;var firstEdgeIndexes=this._f irstEdgeIndexes=new Uint32Array(nodeCount+1);var nodeFieldCount=this._nodeFieldC ount;var edgeFieldsCount=this._edgeFieldsCount;var nodeEdgeCountOffset=this._nod eEdgeCountOffset;firstEdgeIndexes[nodeCount]=this._containmentEdges.length;for(v ar nodeOrdinal=0,edgeIndex=0;nodeOrdinal<nodeCount;++nodeOrdinal){firstEdgeIndex es[nodeOrdinal]=edgeIndex;edgeIndex+=nodes[nodeOrdinal*nodeFieldCount+nodeEdgeCo untOffset]*edgeFieldsCount;}},_buildRetainers:function() 136 {var nodes=this._nodes;var nodeCount=this.nodeCount;var firstEdgeIndexes=this._f irstEdgeIndexes=new Uint32Array(nodeCount+1);var nodeFieldCount=this._nodeFieldC ount;var edgeFieldsCount=this._edgeFieldsCount;var nodeEdgeCountOffset=this._nod eEdgeCountOffset;firstEdgeIndexes[nodeCount]=this._containmentEdges.length;for(v ar nodeOrdinal=0,edgeIndex=0;nodeOrdinal<nodeCount;++nodeOrdinal){firstEdgeIndex es[nodeOrdinal]=edgeIndex;edgeIndex+=nodes[nodeOrdinal*nodeFieldCount+nodeEdgeCo untOffset]*edgeFieldsCount;}},_buildRetainers:function()
95 {var retainingNodes=this._retainingNodes=new Uint32Array(this._edgeCount);var re tainingEdges=this._retainingEdges=new Uint32Array(this._edgeCount);var firstReta inerIndex=this._firstRetainerIndex=new Uint32Array(this.nodeCount+1);var contain mentEdges=this._containmentEdges;var edgeFieldsCount=this._edgeFieldsCount;var n odeFieldCount=this._nodeFieldCount;var edgeToNodeOffset=this._edgeToNodeOffset;v ar nodes=this._nodes;var firstEdgeIndexes=this._firstEdgeIndexes;var nodeCount=t his.nodeCount;for(var toNodeFieldIndex=edgeToNodeOffset,l=containmentEdges.lengt h;toNodeFieldIndex<l;toNodeFieldIndex+=edgeFieldsCount){var toNodeIndex=containm entEdges[toNodeFieldIndex];if(toNodeIndex%nodeFieldCount) 137 {var retainingNodes=this._retainingNodes=new Uint32Array(this._edgeCount);var re tainingEdges=this._retainingEdges=new Uint32Array(this._edgeCount);var firstReta inerIndex=this._firstRetainerIndex=new Uint32Array(this.nodeCount+1);var contain mentEdges=this._containmentEdges;var edgeFieldsCount=this._edgeFieldsCount;var n odeFieldCount=this._nodeFieldCount;var edgeToNodeOffset=this._edgeToNodeOffset;v ar nodes=this._nodes;var firstEdgeIndexes=this._firstEdgeIndexes;var nodeCount=t his.nodeCount;for(var toNodeFieldIndex=edgeToNodeOffset,l=containmentEdges.lengt h;toNodeFieldIndex<l;toNodeFieldIndex+=edgeFieldsCount){var toNodeIndex=containm entEdges[toNodeFieldIndex];if(toNodeIndex%nodeFieldCount)
96 throw new Error("Invalid toNodeIndex "+toNodeIndex);++firstRetainerIndex[toNodeI ndex/nodeFieldCount];} 138 throw new Error("Invalid toNodeIndex "+toNodeIndex);++firstRetainerIndex[toNodeI ndex/nodeFieldCount];}
97 for(var i=0,firstUnusedRetainerSlot=0;i<nodeCount;i++){var retainersCount=firstR etainerIndex[i];firstRetainerIndex[i]=firstUnusedRetainerSlot;retainingNodes[fir stUnusedRetainerSlot]=retainersCount;firstUnusedRetainerSlot+=retainersCount;} 139 for(var i=0,firstUnusedRetainerSlot=0;i<nodeCount;i++){var retainersCount=firstR etainerIndex[i];firstRetainerIndex[i]=firstUnusedRetainerSlot;retainingNodes[fir stUnusedRetainerSlot]=retainersCount;firstUnusedRetainerSlot+=retainersCount;}
98 firstRetainerIndex[nodeCount]=retainingNodes.length;var nextNodeFirstEdgeIndex=f irstEdgeIndexes[0];for(var srcNodeOrdinal=0;srcNodeOrdinal<nodeCount;++srcNodeOr dinal){var firstEdgeIndex=nextNodeFirstEdgeIndex;nextNodeFirstEdgeIndex=firstEdg eIndexes[srcNodeOrdinal+1];var srcNodeIndex=srcNodeOrdinal*nodeFieldCount;for(va r edgeIndex=firstEdgeIndex;edgeIndex<nextNodeFirstEdgeIndex;edgeIndex+=edgeField sCount){var toNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(toNodeIn dex%nodeFieldCount) 140 firstRetainerIndex[nodeCount]=retainingNodes.length;var nextNodeFirstEdgeIndex=f irstEdgeIndexes[0];for(var srcNodeOrdinal=0;srcNodeOrdinal<nodeCount;++srcNodeOr dinal){var firstEdgeIndex=nextNodeFirstEdgeIndex;nextNodeFirstEdgeIndex=firstEdg eIndexes[srcNodeOrdinal+1];var srcNodeIndex=srcNodeOrdinal*nodeFieldCount;for(va r edgeIndex=firstEdgeIndex;edgeIndex<nextNodeFirstEdgeIndex;edgeIndex+=edgeField sCount){var toNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(toNodeIn dex%nodeFieldCount)
99 throw new Error("Invalid toNodeIndex "+toNodeIndex);var firstRetainerSlotIndex=f irstRetainerIndex[toNodeIndex/nodeFieldCount];var nextUnusedRetainerSlotIndex=fi rstRetainerSlotIndex+(--retainingNodes[firstRetainerSlotIndex]);retainingNodes[n extUnusedRetainerSlotIndex]=srcNodeIndex;retainingEdges[nextUnusedRetainerSlotIn dex]=edgeIndex;}}},createNode:function(nodeIndex) 141 throw new Error("Invalid toNodeIndex "+toNodeIndex);var firstRetainerSlotIndex=f irstRetainerIndex[toNodeIndex/nodeFieldCount];var nextUnusedRetainerSlotIndex=fi rstRetainerSlotIndex+(--retainingNodes[firstRetainerSlotIndex]);retainingNodes[n extUnusedRetainerSlotIndex]=srcNodeIndex;retainingEdges[nextUnusedRetainerSlotIn dex]=edgeIndex;}}},createNode:function(nodeIndex)
100 {throw new Error("Not implemented");},createEdge:function(edges,edgeIndex) 142 {throw new Error("Not implemented");},createEdge:function(edges,edgeIndex)
101 {throw new Error("Not implemented");},createRetainingEdge:function(retainedNodeI ndex,retainerIndex) 143 {throw new Error("Not implemented");},createRetainingEdge:function(retainedNodeI ndex,retainerIndex)
102 {throw new Error("Not implemented");},dispose:function() 144 {throw new Error("Not implemented");},dispose:function()
103 {delete this._nodes;delete this._strings;delete this._retainingEdges;delete this ._retainingNodes;delete this._firstRetainerIndex;if(this._aggregates){delete thi s._aggregates;delete this._aggregatesSortedFlags;} 145 {delete this._nodes;delete this._strings;delete this._retainingEdges;delete this ._retainingNodes;delete this._firstRetainerIndex;if(this._aggregates){delete thi s._aggregates;delete this._aggregatesSortedFlags;}
104 delete this._dominatedNodes;delete this._firstDominatedNodeIndex;delete this._no deDistances;delete this._dominatorsTree;},_allNodes:function() 146 delete this._dominatedNodes;delete this._firstDominatedNodeIndex;delete this._no deDistances;delete this._dominatorsTree;},_allNodes:function()
105 {return new WebInspector.HeapSnapshotNodeIterator(this.rootNode());},rootNode:fu nction() 147 {return new WebInspector.HeapSnapshotNodeIterator(this.rootNode());},rootNode:fu nction()
106 {return this.createNode(this._rootNodeIndex);},get rootNodeIndex() 148 {return this.createNode(this._rootNodeIndex);},get rootNodeIndex()
107 {return this._rootNodeIndex;},get totalSize() 149 {return this._rootNodeIndex;},get totalSize()
108 {return this.rootNode().retainedSize();},_getDominatedIndex:function(nodeIndex) 150 {return this.rootNode().retainedSize();},_getDominatedIndex:function(nodeIndex)
109 {if(nodeIndex%this._nodeFieldCount) 151 {if(nodeIndex%this._nodeFieldCount)
110 throw new Error("Invalid nodeIndex: "+nodeIndex);return this._firstDominatedNode Index[nodeIndex/this._nodeFieldCount];},_dominatedNodesOfNode:function(node) 152 throw new Error("Invalid nodeIndex: "+nodeIndex);return this._firstDominatedNode Index[nodeIndex/this._nodeFieldCount];},_dominatedNodesOfNode:function(node)
111 {var dominatedIndexFrom=this._getDominatedIndex(node.nodeIndex);var dominatedInd exTo=this._getDominatedIndex(node._nextNodeIndex());return new WebInspector.Heap SnapshotArraySlice(this._dominatedNodes,dominatedIndexFrom,dominatedIndexTo);},a ggregates:function(sortedIndexes,key,filterString) 153 {var dominatedIndexFrom=this._getDominatedIndex(node.nodeIndex);var dominatedInd exTo=this._getDominatedIndex(node._nextNodeIndex());return new WebInspector.Heap SnapshotArraySlice(this._dominatedNodes,dominatedIndexFrom,dominatedIndexTo);},a ggregates:function(sortedIndexes,key,filterString)
112 {if(!this._aggregates){this._aggregates={};this._aggregatesSortedFlags={};} 154 {if(!this._aggregates){this._aggregates={};this._aggregatesSortedFlags={};}
113 var aggregatesByClassName=this._aggregates[key];if(aggregatesByClassName){if(sor tedIndexes&&!this._aggregatesSortedFlags[key]){this._sortAggregateIndexes(aggreg atesByClassName);this._aggregatesSortedFlags[key]=sortedIndexes;} 155 var aggregatesByClassName=this._aggregates[key];if(aggregatesByClassName){if(sor tedIndexes&&!this._aggregatesSortedFlags[key]){this._sortAggregateIndexes(aggreg atesByClassName);this._aggregatesSortedFlags[key]=sortedIndexes;}
114 return aggregatesByClassName;} 156 return aggregatesByClassName;}
115 var filter;if(filterString) 157 var filter;if(filterString)
116 filter=this._parseFilter(filterString);var aggregates=this._buildAggregates(filt er);this._calculateClassesRetainedSize(aggregates.aggregatesByClassIndex,filter) ;aggregatesByClassName=aggregates.aggregatesByClassName;if(sortedIndexes) 158 filter=this._parseFilter(filterString);var aggregates=this._buildAggregates(filt er);this._calculateClassesRetainedSize(aggregates.aggregatesByClassIndex,filter) ;aggregatesByClassName=aggregates.aggregatesByClassName;if(sortedIndexes)
117 this._sortAggregateIndexes(aggregatesByClassName);this._aggregatesSortedFlags[ke y]=sortedIndexes;this._aggregates[key]=aggregatesByClassName;return aggregatesBy ClassName;},aggregatesForDiff:function() 159 this._sortAggregateIndexes(aggregatesByClassName);this._aggregatesSortedFlags[ke y]=sortedIndexes;this._aggregates[key]=aggregatesByClassName;return aggregatesBy ClassName;},allocationTracesTops:function()
160 {return this._allocationProfile.serializeTraceTops();},allocationNodeCallers:fun ction(nodeId)
161 {return this._allocationProfile.serializeCallers(nodeId);},aggregatesForDiff:fun ction()
118 {if(this._aggregatesForDiff) 162 {if(this._aggregatesForDiff)
119 return this._aggregatesForDiff;var aggregatesByClassName=this.aggregates(true,"a llObjects");this._aggregatesForDiff={};var node=this.createNode();for(var classN ame in aggregatesByClassName){var aggregate=aggregatesByClassName[className];var indexes=aggregate.idxs;var ids=new Array(indexes.length);var selfSizes=new Arra y(indexes.length);for(var i=0;i<indexes.length;i++){node.nodeIndex=indexes[i];id s[i]=node.id();selfSizes[i]=node.selfSize();} 163 return this._aggregatesForDiff;var aggregatesByClassName=this.aggregates(true,"a llObjects");this._aggregatesForDiff={};var node=this.createNode();for(var classN ame in aggregatesByClassName){var aggregate=aggregatesByClassName[className];var indexes=aggregate.idxs;var ids=new Array(indexes.length);var selfSizes=new Arra y(indexes.length);for(var i=0;i<indexes.length;i++){node.nodeIndex=indexes[i];id s[i]=node.id();selfSizes[i]=node.selfSize();}
120 this._aggregatesForDiff[className]={indexes:indexes,ids:ids,selfSizes:selfSizes} ;} 164 this._aggregatesForDiff[className]={indexes:indexes,ids:ids,selfSizes:selfSizes} ;}
121 return this._aggregatesForDiff;},_isUserRoot:function(node) 165 return this._aggregatesForDiff;},_isUserRoot:function(node)
122 {return true;},forEachRoot:function(action,userRootsOnly) 166 {return true;},forEachRoot:function(action,userRootsOnly)
123 {for(var iter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter. edge.node();if(!userRootsOnly||this._isUserRoot(node)) 167 {for(var iter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter. edge.node();if(!userRootsOnly||this._isUserRoot(node))
124 action(node);}},_calculateDistances:function() 168 action(node);}},_calculateDistances:function()
125 {var nodeFieldCount=this._nodeFieldCount;var nodeCount=this.nodeCount;var distan ces=new Int32Array(nodeCount);var noDistance=this._noDistance;for(var i=0;i<node Count;++i) 169 {var nodeFieldCount=this._nodeFieldCount;var nodeCount=this.nodeCount;var distan ces=new Int32Array(nodeCount);var noDistance=this._noDistance;for(var i=0;i<node Count;++i)
126 distances[i]=noDistance;var nodesToVisit=new Uint32Array(this.nodeCount);var nod esToVisitLength=0;function enqueueNode(node) 170 distances[i]=noDistance;var nodesToVisit=new Uint32Array(this.nodeCount);var nod esToVisitLength=0;function enqueueNode(node)
127 {var ordinal=node._ordinal();if(distances[ordinal]!==noDistance) 171 {var ordinal=node._ordinal();if(distances[ordinal]!==noDistance)
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 {var node=this.createNode(nodeIndex);return new WebInspector.HeapSnapshotEdgesPr ovider(this,filter,node.edges());},retainingEdgesFilter:function(showHiddenData) 244 {var node=this.createNode(nodeIndex);return new WebInspector.HeapSnapshotEdgesPr ovider(this,filter,node.edges());},retainingEdgesFilter:function(showHiddenData)
201 {return null;},containmentEdgesFilter:function(showHiddenData) 245 {return null;},containmentEdgesFilter:function(showHiddenData)
202 {return null;},createRetainingEdgesProvider:function(nodeIndex,showHiddenData) 246 {return null;},createRetainingEdgesProvider:function(nodeIndex,showHiddenData)
203 {var node=this.createNode(nodeIndex);var filter=this.retainingEdgesFilter(showHi ddenData);return new WebInspector.HeapSnapshotEdgesProvider(this,filter,node.ret ainers());},createAddedNodesProvider:function(baseSnapshotId,className) 247 {var node=this.createNode(nodeIndex);var filter=this.retainingEdgesFilter(showHi ddenData);return new WebInspector.HeapSnapshotEdgesProvider(this,filter,node.ret ainers());},createAddedNodesProvider:function(baseSnapshotId,className)
204 {var snapshotDiff=this._snapshotDiffs[baseSnapshotId];var diffForClass=snapshotD iff[className];return new WebInspector.HeapSnapshotNodesProvider(this,null,diffF orClass.addedIndexes);},createDeletedNodesProvider:function(nodeIndexes) 248 {var snapshotDiff=this._snapshotDiffs[baseSnapshotId];var diffForClass=snapshotD iff[className];return new WebInspector.HeapSnapshotNodesProvider(this,null,diffF orClass.addedIndexes);},createDeletedNodesProvider:function(nodeIndexes)
205 {return new WebInspector.HeapSnapshotNodesProvider(this,null,nodeIndexes);},clas sNodesFilter:function() 249 {return new WebInspector.HeapSnapshotNodesProvider(this,null,nodeIndexes);},clas sNodesFilter:function()
206 {return null;},createNodesProviderForClass:function(className,aggregatesKey) 250 {return null;},createNodesProviderForClass:function(className,aggregatesKey)
207 {return new WebInspector.HeapSnapshotNodesProvider(this,this.classNodesFilter(), this.aggregates(false,aggregatesKey)[className].idxs);},createNodesProviderForDo minator:function(nodeIndex) 251 {return new WebInspector.HeapSnapshotNodesProvider(this,this.classNodesFilter(), this.aggregates(false,aggregatesKey)[className].idxs);},createNodesProviderForDo minator:function(nodeIndex)
208 {var node=this.createNode(nodeIndex);return new WebInspector.HeapSnapshotNodesPr ovider(this,null,this._dominatedNodesOfNode(node));},updateStaticData:function() 252 {var node=this.createNode(nodeIndex);return new WebInspector.HeapSnapshotNodesPr ovider(this,null,this._dominatedNodesOfNode(node));},updateStaticData:function()
209 {return{nodeCount:this.nodeCount,rootNodeIndex:this._rootNodeIndex,totalSize:thi s.totalSize,uid:this.uid};}};WebInspector.HeapSnapshotFilteredOrderedIterator=fu nction(iterator,filter,unfilteredIterationOrder) 253 {return{nodeCount:this.nodeCount,rootNodeIndex:this._rootNodeIndex,totalSize:thi s.totalSize,uid:this.uid};}};WebInspector.HeapSnapshotFilteredOrderedIterator=fu nction(iterator,filter,unfilteredIterationOrder)
210 {this._filter=filter;this._iterator=iterator;this._unfilteredIterationOrder=unfi lteredIterationOrder;this._iterationOrder=null;this._position=0;this._currentCom parator=null;this._sortedPrefixLength=0;} 254 {this._filter=filter;this._iterator=iterator;this._unfilteredIterationOrder=unfi lteredIterationOrder;this._iterationOrder=null;this._position=0;this._currentCom parator=null;this._sortedPrefixLength=0;this._sortedSuffixLength=0;}
211 WebInspector.HeapSnapshotFilteredOrderedIterator.prototype={_createIterationOrde r:function() 255 WebInspector.HeapSnapshotFilteredOrderedIterator.prototype={_createIterationOrde r:function()
212 {if(this._iterationOrder) 256 {if(this._iterationOrder)
213 return;if(this._unfilteredIterationOrder&&!this._filter){this._iterationOrder=th is._unfilteredIterationOrder.slice(0);this._unfilteredIterationOrder=null;return ;} 257 return;if(this._unfilteredIterationOrder&&!this._filter){this._iterationOrder=th is._unfilteredIterationOrder.slice(0);this._unfilteredIterationOrder=null;return ;}
214 this._iterationOrder=[];var iterator=this._iterator;if(!this._unfilteredIteratio nOrder&&!this._filter){for(iterator.rewind();iterator.hasNext();iterator.next()) 258 this._iterationOrder=[];var iterator=this._iterator;if(!this._unfilteredIteratio nOrder&&!this._filter){for(iterator.rewind();iterator.hasNext();iterator.next())
215 this._iterationOrder.push(iterator.index());}else if(!this._unfilteredIterationO rder){for(iterator.rewind();iterator.hasNext();iterator.next()){if(this._filter( iterator.item())) 259 this._iterationOrder.push(iterator.index());}else if(!this._unfilteredIterationO rder){for(iterator.rewind();iterator.hasNext();iterator.next()){if(this._filter( iterator.item()))
216 this._iterationOrder.push(iterator.index());}}else{var order=this._unfilteredIte rationOrder.constructor===Array?this._unfilteredIterationOrder:this._unfilteredI terationOrder.slice(0);for(var i=0,l=order.length;i<l;++i){iterator.setIndex(ord er[i]);if(this._filter(iterator.item())) 260 this._iterationOrder.push(iterator.index());}}else{var order=this._unfilteredIte rationOrder.constructor===Array?this._unfilteredIterationOrder:this._unfilteredI terationOrder.slice(0);for(var i=0,l=order.length;i<l;++i){iterator.setIndex(ord er[i]);if(this._filter(iterator.item()))
217 this._iterationOrder.push(iterator.index());} 261 this._iterationOrder.push(iterator.index());}
218 this._unfilteredIterationOrder=null;}},rewind:function() 262 this._unfilteredIterationOrder=null;}},rewind:function()
219 {this._position=0;},hasNext:function() 263 {this._position=0;},hasNext:function()
220 {return this._position<this._iterationOrder.length;},isEmpty:function() 264 {return this._position<this._iterationOrder.length;},isEmpty:function()
221 {if(this._iterationOrder) 265 {if(this._iterationOrder)
222 return!this._iterationOrder.length;if(this._unfilteredIterationOrder&&!this._fil ter) 266 return!this._iterationOrder.length;if(this._unfilteredIterationOrder&&!this._fil ter)
223 return!this._unfilteredIterationOrder.length;var iterator=this._iterator;if(!thi s._unfilteredIterationOrder&&!this._filter){iterator.rewind();return!iterator.ha sNext();}else if(!this._unfilteredIterationOrder){for(iterator.rewind();iterator .hasNext();iterator.next()) 267 return!this._unfilteredIterationOrder.length;var iterator=this._iterator;if(!thi s._unfilteredIterationOrder&&!this._filter){iterator.rewind();return!iterator.ha sNext();}else if(!this._unfilteredIterationOrder){for(iterator.rewind();iterator .hasNext();iterator.next())
224 if(this._filter(iterator.item())) 268 if(this._filter(iterator.item()))
225 return false;}else{var order=this._unfilteredIterationOrder.constructor===Array? this._unfilteredIterationOrder:this._unfilteredIterationOrder.slice(0);for(var i =0,l=order.length;i<l;++i){iterator.setIndex(order[i]);if(this._filter(iterator. item())) 269 return false;}else{var order=this._unfilteredIterationOrder.constructor===Array? this._unfilteredIterationOrder:this._unfilteredIterationOrder.slice(0);for(var i =0,l=order.length;i<l;++i){iterator.setIndex(order[i]);if(this._filter(iterator. item()))
226 return false;}} 270 return false;}}
227 return true;},item:function() 271 return true;},item:function()
228 {this._iterator.setIndex(this._iterationOrder[this._position]);return this._iter ator.item();},get length() 272 {this._iterator.setIndex(this._iterationOrder[this._position]);return this._iter ator.item();},get length()
229 {this._createIterationOrder();return this._iterationOrder.length;},next:function () 273 {this._createIterationOrder();return this._iterationOrder.length;},next:function ()
230 {++this._position;},serializeItemsRange:function(begin,end) 274 {++this._position;},serializeItemsRange:function(begin,end)
231 {this._createIterationOrder();if(begin>end) 275 {this._createIterationOrder();if(begin>end)
232 throw new Error("Start position > end position: "+begin+" > "+end);if(end>=this. _iterationOrder.length) 276 throw new Error("Start position > end position: "+begin+" > "+end);if(end>this._ iterationOrder.length)
233 end=this._iterationOrder.length;if(this._sortedPrefixLength<end){this.sort(this. _currentComparator,this._sortedPrefixLength,this._iterationOrder.length-1,end-th is._sortedPrefixLength);this._sortedPrefixLength=end;} 277 end=this._iterationOrder.length;if(this._sortedPrefixLength<end&&begin<this._ite rationOrder.length-this._sortedSuffixLength){this.sort(this._currentComparator,t his._sortedPrefixLength,this._iterationOrder.length-1-this._sortedSuffixLength,b egin,end-1);if(begin<=this._sortedPrefixLength)
278 this._sortedPrefixLength=end;if(end>=this._iterationOrder.length-this._sortedSuf fixLength)
279 this._sortedSuffixLength=this._iterationOrder.length-begin;}
234 this._position=begin;var startPosition=this._position;var count=end-begin;var re sult=new Array(count);for(var i=0;i<count&&this.hasNext();++i,this.next()) 280 this._position=begin;var startPosition=this._position;var count=end-begin;var re sult=new Array(count);for(var i=0;i<count&&this.hasNext();++i,this.next())
235 result[i]=this.item().serialize();result.length=i;result.totalLength=this._itera tionOrder.length;result.startPosition=startPosition;result.endPosition=this._pos ition;return result;},sortAll:function() 281 result[i]=this.item().serialize();result.length=i;result.totalLength=this._itera tionOrder.length;result.startPosition=startPosition;result.endPosition=this._pos ition;return result;},sortAll:function()
236 {this._createIterationOrder();if(this._sortedPrefixLength===this._iterationOrder .length) 282 {this._createIterationOrder();if(this._sortedPrefixLength+this._sortedSuffixLeng th>=this._iterationOrder.length)
237 return;this.sort(this._currentComparator,this._sortedPrefixLength,this._iteratio nOrder.length-1,this._iterationOrder.length);this._sortedPrefixLength=this._iter ationOrder.length;},sortAndRewind:function(comparator) 283 return;this.sort(this._currentComparator,this._sortedPrefixLength,this._iteratio nOrder.length-1-this._sortedSuffixLength,this._sortedPrefixLength,this._iteratio nOrder.length-1-this._sortedSuffixLength);this._sortedPrefixLength=this._iterati onOrder.length;this._sortedSuffixLength=0;},sortAndRewind:function(comparator)
238 {this._currentComparator=comparator;this._sortedPrefixLength=0;this.rewind();}} 284 {this._currentComparator=comparator;this._sortedPrefixLength=0;this._sortedSuffi xLength=0;this.rewind();}}
239 WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.createComparator=func tion(fieldNames) 285 WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.createComparator=func tion(fieldNames)
240 {return{fieldName1:fieldNames[0],ascending1:fieldNames[1],fieldName2:fieldNames[ 2],ascending2:fieldNames[3]};} 286 {return{fieldName1:fieldNames[0],ascending1:fieldNames[1],fieldName2:fieldNames[ 2],ascending2:fieldNames[3]};}
241 WebInspector.HeapSnapshotEdgesProvider=function(snapshot,filter,edgesIter) 287 WebInspector.HeapSnapshotEdgesProvider=function(snapshot,filter,edgesIter)
242 {this.snapshot=snapshot;WebInspector.HeapSnapshotFilteredOrderedIterator.call(th is,edgesIter,filter);} 288 {this.snapshot=snapshot;WebInspector.HeapSnapshotFilteredOrderedIterator.call(th is,edgesIter,filter);}
243 WebInspector.HeapSnapshotEdgesProvider.prototype={sort:function(comparator,leftB ound,rightBound,count) 289 WebInspector.HeapSnapshotEdgesProvider.prototype={sort:function(comparator,leftB ound,rightBound,windowLeft,windowRight)
244 {var fieldName1=comparator.fieldName1;var fieldName2=comparator.fieldName2;var a scending1=comparator.ascending1;var ascending2=comparator.ascending2;var edgeA=t his._iterator.item().clone();var edgeB=edgeA.clone();var nodeA=this.snapshot.cre ateNode();var nodeB=this.snapshot.createNode();function compareEdgeFieldName(asc ending,indexA,indexB) 290 {var fieldName1=comparator.fieldName1;var fieldName2=comparator.fieldName2;var a scending1=comparator.ascending1;var ascending2=comparator.ascending2;var edgeA=t his._iterator.item().clone();var edgeB=edgeA.clone();var nodeA=this.snapshot.cre ateNode();var nodeB=this.snapshot.createNode();function compareEdgeFieldName(asc ending,indexA,indexB)
245 {edgeA.edgeIndex=indexA;edgeB.edgeIndex=indexB;if(edgeB.name()==="__proto__")ret urn-1;if(edgeA.name()==="__proto__")return 1;var result=edgeA.hasStringName()=== edgeB.hasStringName()?(edgeA.name()<edgeB.name()?-1:(edgeA.name()>edgeB.name()?1 :0)):(edgeA.hasStringName()?-1:1);return ascending?result:-result;} 291 {edgeA.edgeIndex=indexA;edgeB.edgeIndex=indexB;if(edgeB.name()==="__proto__")ret urn-1;if(edgeA.name()==="__proto__")return 1;var result=edgeA.hasStringName()=== edgeB.hasStringName()?(edgeA.name()<edgeB.name()?-1:(edgeA.name()>edgeB.name()?1 :0)):(edgeA.hasStringName()?-1:1);return ascending?result:-result;}
246 function compareNodeField(fieldName,ascending,indexA,indexB) 292 function compareNodeField(fieldName,ascending,indexA,indexB)
247 {edgeA.edgeIndex=indexA;nodeA.nodeIndex=edgeA.nodeIndex();var valueA=nodeA[field Name]();edgeB.edgeIndex=indexB;nodeB.nodeIndex=edgeB.nodeIndex();var valueB=node B[fieldName]();var result=valueA<valueB?-1:(valueA>valueB?1:0);return ascending? result:-result;} 293 {edgeA.edgeIndex=indexA;nodeA.nodeIndex=edgeA.nodeIndex();var valueA=nodeA[field Name]();edgeB.edgeIndex=indexB;nodeB.nodeIndex=edgeB.nodeIndex();var valueB=node B[fieldName]();var result=valueA<valueB?-1:(valueA>valueB?1:0);return ascending? result:-result;}
248 function compareEdgeAndNode(indexA,indexB){var result=compareEdgeFieldName(ascen ding1,indexA,indexB);if(result===0) 294 function compareEdgeAndNode(indexA,indexB){var result=compareEdgeFieldName(ascen ding1,indexA,indexB);if(result===0)
249 result=compareNodeField(fieldName2,ascending2,indexA,indexB);return result;} 295 result=compareNodeField(fieldName2,ascending2,indexA,indexB);if(result===0)
296 return indexA-indexB;return result;}
250 function compareNodeAndEdge(indexA,indexB){var result=compareNodeField(fieldName 1,ascending1,indexA,indexB);if(result===0) 297 function compareNodeAndEdge(indexA,indexB){var result=compareNodeField(fieldName 1,ascending1,indexA,indexB);if(result===0)
251 result=compareEdgeFieldName(ascending2,indexA,indexB);return result;} 298 result=compareEdgeFieldName(ascending2,indexA,indexB);if(result===0)
299 return indexA-indexB;return result;}
252 function compareNodeAndNode(indexA,indexB){var result=compareNodeField(fieldName 1,ascending1,indexA,indexB);if(result===0) 300 function compareNodeAndNode(indexA,indexB){var result=compareNodeField(fieldName 1,ascending1,indexA,indexB);if(result===0)
253 result=compareNodeField(fieldName2,ascending2,indexA,indexB);return result;} 301 result=compareNodeField(fieldName2,ascending2,indexA,indexB);if(result===0)
302 return indexA-indexB;return result;}
254 if(fieldName1==="!edgeName") 303 if(fieldName1==="!edgeName")
255 this._iterationOrder.sortRange(compareEdgeAndNode,leftBound,rightBound,count);el se if(fieldName2==="!edgeName") 304 this._iterationOrder.sortRange(compareEdgeAndNode,leftBound,rightBound,windowLef t,windowRight);else if(fieldName2==="!edgeName")
256 this._iterationOrder.sortRange(compareNodeAndEdge,leftBound,rightBound,count);el se 305 this._iterationOrder.sortRange(compareNodeAndEdge,leftBound,rightBound,windowLef t,windowRight);else
257 this._iterationOrder.sortRange(compareNodeAndNode,leftBound,rightBound,count);}, __proto__:WebInspector.HeapSnapshotFilteredOrderedIterator.prototype} 306 this._iterationOrder.sortRange(compareNodeAndNode,leftBound,rightBound,windowLef t,windowRight);},__proto__:WebInspector.HeapSnapshotFilteredOrderedIterator.prot otype}
258 WebInspector.HeapSnapshotNodesProvider=function(snapshot,filter,nodeIndexes) 307 WebInspector.HeapSnapshotNodesProvider=function(snapshot,filter,nodeIndexes)
259 {this.snapshot=snapshot;WebInspector.HeapSnapshotFilteredOrderedIterator.call(th is,snapshot._allNodes(),filter,nodeIndexes);} 308 {this.snapshot=snapshot;WebInspector.HeapSnapshotFilteredOrderedIterator.call(th is,snapshot._allNodes(),filter,nodeIndexes);}
260 WebInspector.HeapSnapshotNodesProvider.prototype={nodePosition:function(snapshot ObjectId) 309 WebInspector.HeapSnapshotNodesProvider.prototype={nodePosition:function(snapshot ObjectId)
261 {this._createIterationOrder();if(this.isEmpty()) 310 {this._createIterationOrder();if(this.isEmpty())
262 return-1;this.sortAll();var node=this.snapshot.createNode();for(var i=0;i<this._ iterationOrder.length;i++){node.nodeIndex=this._iterationOrder[i];if(node.id()== =snapshotObjectId) 311 return-1;this.sortAll();var node=this.snapshot.createNode();for(var i=0;i<this._ iterationOrder.length;i++){node.nodeIndex=this._iterationOrder[i];if(node.id()== =snapshotObjectId)
263 return i;} 312 return i;}
264 return-1;},sort:function(comparator,leftBound,rightBound,count) 313 return-1;},sort:function(comparator,leftBound,rightBound,windowLeft,windowRight)
265 {var fieldName1=comparator.fieldName1;var fieldName2=comparator.fieldName2;var a scending1=comparator.ascending1;var ascending2=comparator.ascending2;var nodeA=t his.snapshot.createNode();var nodeB=this.snapshot.createNode();function sortByNo deField(fieldName,ascending) 314 {var fieldName1=comparator.fieldName1;var fieldName2=comparator.fieldName2;var a scending1=comparator.ascending1;var ascending2=comparator.ascending2;var nodeA=t his.snapshot.createNode();var nodeB=this.snapshot.createNode();function sortByNo deField(fieldName,ascending)
266 {var valueOrFunctionA=nodeA[fieldName];var valueA=typeof valueOrFunctionA!=="fun ction"?valueOrFunctionA:valueOrFunctionA.call(nodeA);var valueOrFunctionB=nodeB[ fieldName];var valueB=typeof valueOrFunctionB!=="function"?valueOrFunctionB:valu eOrFunctionB.call(nodeB);var result=valueA<valueB?-1:(valueA>valueB?1:0);return ascending?result:-result;} 315 {var valueOrFunctionA=nodeA[fieldName];var valueA=typeof valueOrFunctionA!=="fun ction"?valueOrFunctionA:valueOrFunctionA.call(nodeA);var valueOrFunctionB=nodeB[ fieldName];var valueB=typeof valueOrFunctionB!=="function"?valueOrFunctionB:valu eOrFunctionB.call(nodeB);var result=valueA<valueB?-1:(valueA>valueB?1:0);return ascending?result:-result;}
267 function sortByComparator(indexA,indexB){nodeA.nodeIndex=indexA;nodeB.nodeIndex= indexB;var result=sortByNodeField(fieldName1,ascending1);if(result===0) 316 function sortByComparator(indexA,indexB){nodeA.nodeIndex=indexA;nodeB.nodeIndex= indexB;var result=sortByNodeField(fieldName1,ascending1);if(result===0)
268 result=sortByNodeField(fieldName2,ascending2);return result;} 317 result=sortByNodeField(fieldName2,ascending2);if(result===0)
269 this._iterationOrder.sortRange(sortByComparator,leftBound,rightBound,count);},__ proto__:WebInspector.HeapSnapshotFilteredOrderedIterator.prototype};WebInspector .HeapSnapshotLoader=function() 318 return indexA-indexB;return result;}
270 {this._reset();} 319 this._iterationOrder.sortRange(sortByComparator,leftBound,rightBound,windowLeft, windowRight);},__proto__:WebInspector.HeapSnapshotFilteredOrderedIterator.protot ype};WebInspector.HeapSnapshotLoader=function(dispatcher)
320 {this._reset();this._progress=new WebInspector.HeapSnapshotProgress(dispatcher); }
271 WebInspector.HeapSnapshotLoader.prototype={dispose:function() 321 WebInspector.HeapSnapshotLoader.prototype={dispose:function()
272 {this._reset();},_reset:function() 322 {this._reset();},_reset:function()
273 {this._json="";this._state="find-snapshot-info";this._snapshot={};},close:functi on() 323 {this._json="";this._state="find-snapshot-info";this._snapshot={};},close:functi on()
274 {if(this._json) 324 {if(this._json)
275 this._parseStringsArray();},buildSnapshot:function(constructorName) 325 this._parseStringsArray();},buildSnapshot:function(constructorName)
276 {var constructor=WebInspector[constructorName];var result=new constructor(this._ snapshot);this._reset();return result;},_parseUintArray:function() 326 {this._progress.updateStatus("Processing snapshot\u2026");var constructor=WebIns pector[constructorName];var result=new constructor(this._snapshot,this._progress );this._reset();return result;},_parseUintArray:function()
277 {var index=0;var char0="0".charCodeAt(0),char9="9".charCodeAt(0),closingBracket= "]".charCodeAt(0);var length=this._json.length;while(true){while(index<length){v ar code=this._json.charCodeAt(index);if(char0<=code&&code<=char9) 327 {var index=0;var char0="0".charCodeAt(0),char9="9".charCodeAt(0),closingBracket= "]".charCodeAt(0);var length=this._json.length;while(true){while(index<length){v ar code=this._json.charCodeAt(index);if(char0<=code&&code<=char9)
278 break;else if(code===closingBracket){this._json=this._json.slice(index+1);return false;} 328 break;else if(code===closingBracket){this._json=this._json.slice(index+1);return false;}
279 ++index;} 329 ++index;}
280 if(index===length){this._json="";return true;} 330 if(index===length){this._json="";return true;}
281 var nextNumber=0;var startIndex=index;while(index<length){var code=this._json.ch arCodeAt(index);if(char0>code||code>char9) 331 var nextNumber=0;var startIndex=index;while(index<length){var code=this._json.ch arCodeAt(index);if(char0>code||code>char9)
282 break;nextNumber*=10;nextNumber+=(code-char0);++index;} 332 break;nextNumber*=10;nextNumber+=(code-char0);++index;}
283 if(index===length){this._json=this._json.slice(startIndex);return true;} 333 if(index===length){this._json=this._json.slice(startIndex);return true;}
284 this._array[this._arrayIndex++]=nextNumber;}},_parseStringsArray:function() 334 this._array[this._arrayIndex++]=nextNumber;}},_parseStringsArray:function()
285 {var closingBracketIndex=this._json.lastIndexOf("]");if(closingBracketIndex===-1 ) 335 {this._progress.updateStatus("Parsing strings\u2026");var closingBracketIndex=th is._json.lastIndexOf("]");if(closingBracketIndex===-1)
286 throw new Error("Incomplete JSON");this._json=this._json.slice(0,closingBracketI ndex+1);this._snapshot.strings=JSON.parse(this._json);},write:function(chunk) 336 throw new Error("Incomplete JSON");this._json=this._json.slice(0,closingBracketI ndex+1);this._snapshot.strings=JSON.parse(this._json);},write:function(chunk)
287 {this._json+=chunk;switch(this._state){case"find-snapshot-info":{var snapshotTok en="\"snapshot\"";var snapshotTokenIndex=this._json.indexOf(snapshotToken);if(sn apshotTokenIndex===-1) 337 {this._json+=chunk;while(true){switch(this._state){case"find-snapshot-info":{var snapshotToken="\"snapshot\"";var snapshotTokenIndex=this._json.indexOf(snapshot Token);if(snapshotTokenIndex===-1)
288 throw new Error("Snapshot token not found");this._json=this._json.slice(snapshot TokenIndex+snapshotToken.length+1);this._state="parse-snapshot-info";} 338 throw new Error("Snapshot token not found");this._json=this._json.slice(snapshot TokenIndex+snapshotToken.length+1);this._state="parse-snapshot-info";this._progr ess.updateStatus("Loading snapshot info\u2026");break;}
289 case"parse-snapshot-info":{var closingBracketIndex=WebInspector.findBalancedCurl yBrackets(this._json);if(closingBracketIndex===-1) 339 case"parse-snapshot-info":{var closingBracketIndex=WebInspector.findBalancedCurl yBrackets(this._json);if(closingBracketIndex===-1)
290 return;this._snapshot.snapshot=(JSON.parse(this._json.slice(0,closingBracketInde x)));this._json=this._json.slice(closingBracketIndex);this._state="find-nodes";} 340 return;this._snapshot.snapshot=(JSON.parse(this._json.slice(0,closingBracketInde x)));this._json=this._json.slice(closingBracketIndex);this._state="find-nodes";b reak;}
291 case"find-nodes":{var nodesToken="\"nodes\"";var nodesTokenIndex=this._json.inde xOf(nodesToken);if(nodesTokenIndex===-1) 341 case"find-nodes":{var nodesToken="\"nodes\"";var nodesTokenIndex=this._json.inde xOf(nodesToken);if(nodesTokenIndex===-1)
292 return;var bracketIndex=this._json.indexOf("[",nodesTokenIndex);if(bracketIndex= ==-1) 342 return;var bracketIndex=this._json.indexOf("[",nodesTokenIndex);if(bracketIndex= ==-1)
293 return;this._json=this._json.slice(bracketIndex+1);var node_fields_count=this._s napshot.snapshot.meta.node_fields.length;var nodes_length=this._snapshot.snapsho t.node_count*node_fields_count;this._array=new Uint32Array(nodes_length);this._a rrayIndex=0;this._state="parse-nodes";} 343 return;this._json=this._json.slice(bracketIndex+1);var node_fields_count=this._s napshot.snapshot.meta.node_fields.length;var nodes_length=this._snapshot.snapsho t.node_count*node_fields_count;this._array=new Uint32Array(nodes_length);this._a rrayIndex=0;this._state="parse-nodes";break;}
294 case"parse-nodes":{if(this._parseUintArray()) 344 case"parse-nodes":{var hasMoreData=this._parseUintArray();this._progress.updateP rogress("Loading nodes\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo reData)
295 return;this._snapshot.nodes=this._array;this._state="find-edges";this._array=nul l;} 345 return;this._snapshot.nodes=this._array;this._state="find-edges";this._array=nul l;break;}
296 case"find-edges":{var edgesToken="\"edges\"";var edgesTokenIndex=this._json.inde xOf(edgesToken);if(edgesTokenIndex===-1) 346 case"find-edges":{var edgesToken="\"edges\"";var edgesTokenIndex=this._json.inde xOf(edgesToken);if(edgesTokenIndex===-1)
297 return;var bracketIndex=this._json.indexOf("[",edgesTokenIndex);if(bracketIndex= ==-1) 347 return;var bracketIndex=this._json.indexOf("[",edgesTokenIndex);if(bracketIndex= ==-1)
298 return;this._json=this._json.slice(bracketIndex+1);var edge_fields_count=this._s napshot.snapshot.meta.edge_fields.length;var edges_length=this._snapshot.snapsho t.edge_count*edge_fields_count;this._array=new Uint32Array(edges_length);this._a rrayIndex=0;this._state="parse-edges";} 348 return;this._json=this._json.slice(bracketIndex+1);var edge_fields_count=this._s napshot.snapshot.meta.edge_fields.length;var edges_length=this._snapshot.snapsho t.edge_count*edge_fields_count;this._array=new Uint32Array(edges_length);this._a rrayIndex=0;this._state="parse-edges";break;}
299 case"parse-edges":{if(this._parseUintArray()) 349 case"parse-edges":{var hasMoreData=this._parseUintArray();this._progress.updateP rogress("Loading edges\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo reData)
300 return;this._snapshot.edges=this._array;this._array=null;this._state="find-strin gs";} 350 return;this._snapshot.edges=this._array;this._array=null;if(WebInspector.HeapSna pshot.enableAllocationProfiler)
351 this._state="find-trace-function-infos";else
352 this._state="find-strings";break;}
353 case"find-trace-function-infos":{var tracesToken="\"trace_function_infos\"";var tracesTokenIndex=this._json.indexOf(tracesToken);if(tracesTokenIndex===-1)
354 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex ===-1)
355 return;this._json=this._json.slice(bracketIndex+1);var trace_function_info_field _count=3;var trace_function_info_length=this._snapshot.snapshot.trace_function_c ount*trace_function_info_field_count;this._array=new Uint32Array(trace_function_ info_length);this._arrayIndex=0;this._state="parse-trace-function-infos";break;}
356 case"parse-trace-function-infos":{if(this._parseUintArray())
357 return;this._snapshot.trace_function_infos=this._array;this._array=null;this._st ate="find-trace-tree";break;}
358 case"find-trace-tree":{var tracesToken="\"trace_tree\"";var tracesTokenIndex=thi s._json.indexOf(tracesToken);if(tracesTokenIndex===-1)
359 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex ===-1)
360 return;this._json=this._json.slice(bracketIndex);this._state="parse-trace-tree"; break;}
361 case"parse-trace-tree":{var stringsToken="\"strings\"";var stringsTokenIndex=thi s._json.indexOf(stringsToken);if(stringsTokenIndex===-1)
362 return;var bracketIndex=this._json.lastIndexOf("]",stringsTokenIndex);this._snap shot.trace_tree=JSON.parse(this._json.substring(0,bracketIndex+1));this._json=th is._json.slice(bracketIndex);this._state="find-strings";this._progress.updateSta tus("Loading strings\u2026");break;}
301 case"find-strings":{var stringsToken="\"strings\"";var stringsTokenIndex=this._j son.indexOf(stringsToken);if(stringsTokenIndex===-1) 363 case"find-strings":{var stringsToken="\"strings\"";var stringsTokenIndex=this._j son.indexOf(stringsToken);if(stringsTokenIndex===-1)
302 return;var bracketIndex=this._json.indexOf("[",stringsTokenIndex);if(bracketInde x===-1) 364 return;var bracketIndex=this._json.indexOf("[",stringsTokenIndex);if(bracketInde x===-1)
303 return;this._json=this._json.slice(bracketIndex);this._state="accumulate-strings ";break;} 365 return;this._json=this._json.slice(bracketIndex);this._state="accumulate-strings ";break;}
304 case"accumulate-strings":break;}}};;WebInspector.HeapSnapshotWorkerDispatcher=fu nction(globalObject,postMessage) 366 case"accumulate-strings":return;}}}};;WebInspector.HeapSnapshotWorkerDispatcher= function(globalObject,postMessage)
305 {this._objects=[];this._global=globalObject;this._postMessage=postMessage;} 367 {this._objects=[];this._global=globalObject;this._postMessage=postMessage;}
306 WebInspector.HeapSnapshotWorkerDispatcher.prototype={_findFunction:function(name ) 368 WebInspector.HeapSnapshotWorkerDispatcher.prototype={_findFunction:function(name )
307 {var path=name.split(".");var result=this._global;for(var i=0;i<path.length;++i) 369 {var path=name.split(".");var result=this._global;for(var i=0;i<path.length;++i)
308 result=result[path[i]];return result;},dispatchMessage:function(event) 370 result=result[path[i]];return result;},sendEvent:function(name,data)
309 {var data=event.data;var response={callId:data.callId};try{switch(data.dispositi on){case"create":{var constructorFunction=this._findFunction(data.methodName);th is._objects[data.objectId]=new constructorFunction();break;} 371 {this._postMessage({eventName:name,data:data});},dispatchMessage:function(event)
372 {var data=event.data;var response={callId:data.callId};try{switch(data.dispositi on){case"create":{var constructorFunction=this._findFunction(data.methodName);th is._objects[data.objectId]=new constructorFunction(this);break;}
310 case"dispose":{delete this._objects[data.objectId];break;} 373 case"dispose":{delete this._objects[data.objectId];break;}
311 case"getter":{var object=this._objects[data.objectId];var result=object[data.met hodName];response.result=result;break;} 374 case"getter":{var object=this._objects[data.objectId];var result=object[data.met hodName];response.result=result;break;}
312 case"factory":{var object=this._objects[data.objectId];var result=object[data.me thodName].apply(object,data.methodArguments);if(result) 375 case"factory":{var object=this._objects[data.objectId];var result=object[data.me thodName].apply(object,data.methodArguments);if(result)
313 this._objects[data.newObjectId]=result;response.result=!!result;break;} 376 this._objects[data.newObjectId]=result;response.result=!!result;break;}
314 case"method":{var object=this._objects[data.objectId];response.result=object[dat a.methodName].apply(object,data.methodArguments);break;}}}catch(e){response.erro r=e.toString();response.errorCallStack=e.stack;if(data.methodName) 377 case"method":{var object=this._objects[data.objectId];response.result=object[dat a.methodName].apply(object,data.methodArguments);break;}}}catch(e){response.erro r=e.toString();response.errorCallStack=e.stack;if(data.methodName)
315 response.errorMethodName=data.methodName;} 378 response.errorMethodName=data.methodName;}
316 this._postMessage(response);}};;WebInspector.JSHeapSnapshot=function(profile) 379 this._postMessage(response);}};;WebInspector.JSHeapSnapshot=function(profile,pro gress)
317 {this._nodeFlags={canBeQueried:1,detachedDOMTreeNode:2,pageObject:4,visitedMarke rMask:0x0ffff,visitedMarker:0x10000};WebInspector.HeapSnapshot.call(this,profile );} 380 {this._nodeFlags={canBeQueried:1,detachedDOMTreeNode:2,pageObject:4,visitedMarke rMask:0x0ffff,visitedMarker:0x10000};this._lazyStringCache={};WebInspector.HeapS napshot.call(this,profile,progress);}
318 WebInspector.JSHeapSnapshot.prototype={createNode:function(nodeIndex) 381 WebInspector.JSHeapSnapshot.prototype={createNode:function(nodeIndex)
319 {return new WebInspector.JSHeapSnapshotNode(this,nodeIndex);},createEdge:functio n(edges,edgeIndex) 382 {return new WebInspector.JSHeapSnapshotNode(this,nodeIndex);},createEdge:functio n(edges,edgeIndex)
320 {return new WebInspector.JSHeapSnapshotEdge(this,edges,edgeIndex);},createRetain ingEdge:function(retainedNodeIndex,retainerIndex) 383 {return new WebInspector.JSHeapSnapshotEdge(this,edges,edgeIndex);},createRetain ingEdge:function(retainedNodeIndex,retainerIndex)
321 {return new WebInspector.JSHeapSnapshotRetainerEdge(this,retainedNodeIndex,retai nerIndex);},classNodesFilter:function() 384 {return new WebInspector.JSHeapSnapshotRetainerEdge(this,retainedNodeIndex,retai nerIndex);},classNodesFilter:function()
322 {function filter(node) 385 {function filter(node)
323 {return node.isUserObject();} 386 {return node.isUserObject();}
324 return filter;},containmentEdgesFilter:function(showHiddenData) 387 return filter;},containmentEdgesFilter:function(showHiddenData)
325 {function filter(edge){if(edge.isInvisible()) 388 {function filter(edge){if(edge.isInvisible())
326 return false;if(showHiddenData) 389 return false;if(showHiddenData)
327 return true;return!edge.isHidden()&&!edge.node().isHidden();} 390 return true;return!edge.isHidden()&&!edge.node().isHidden();}
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 continue;list.push(childNodeOrdinal);}}},_markPageOwnedNodes:function() 432 continue;list.push(childNodeOrdinal);}}},_markPageOwnedNodes:function()
370 {var edgeShortcutType=this._edgeShortcutType;var edgeElementType=this._edgeEleme ntType;var edgeToNodeOffset=this._edgeToNodeOffset;var edgeTypeOffset=this._edge TypeOffset;var edgeFieldsCount=this._edgeFieldsCount;var edgeWeakType=this._edge WeakType;var firstEdgeIndexes=this._firstEdgeIndexes;var containmentEdges=this._ containmentEdges;var containmentEdgesLength=containmentEdges.length;var nodes=th is._nodes;var nodeFieldCount=this._nodeFieldCount;var nodesCount=this.nodeCount; var flags=this._flags;var flag=this._nodeFlags.pageObject;var visitedMarker=this ._nodeFlags.visitedMarker;var visitedMarkerMask=this._nodeFlags.visitedMarkerMas k;var markerAndFlag=visitedMarker|flag;var nodesToVisit=new Uint32Array(nodesCou nt);var nodesToVisitLength=0;var rootNodeOrdinal=this._rootNodeIndex/nodeFieldCo unt;var node=this.rootNode();for(var edgeIndex=firstEdgeIndexes[rootNodeOrdinal] ,endEdgeIndex=firstEdgeIndexes[rootNodeOrdinal+1];edgeIndex<endEdgeIndex;edgeInd ex+=edgeFieldsCount){var edgeType=containmentEdges[edgeIndex+edgeTypeOffset];var nodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(edgeType===edgeElemen tType){node.nodeIndex=nodeIndex;if(!node.isDocumentDOMTreesRoot()) 433 {var edgeShortcutType=this._edgeShortcutType;var edgeElementType=this._edgeEleme ntType;var edgeToNodeOffset=this._edgeToNodeOffset;var edgeTypeOffset=this._edge TypeOffset;var edgeFieldsCount=this._edgeFieldsCount;var edgeWeakType=this._edge WeakType;var firstEdgeIndexes=this._firstEdgeIndexes;var containmentEdges=this._ containmentEdges;var containmentEdgesLength=containmentEdges.length;var nodes=th is._nodes;var nodeFieldCount=this._nodeFieldCount;var nodesCount=this.nodeCount; var flags=this._flags;var flag=this._nodeFlags.pageObject;var visitedMarker=this ._nodeFlags.visitedMarker;var visitedMarkerMask=this._nodeFlags.visitedMarkerMas k;var markerAndFlag=visitedMarker|flag;var nodesToVisit=new Uint32Array(nodesCou nt);var nodesToVisitLength=0;var rootNodeOrdinal=this._rootNodeIndex/nodeFieldCo unt;var node=this.rootNode();for(var edgeIndex=firstEdgeIndexes[rootNodeOrdinal] ,endEdgeIndex=firstEdgeIndexes[rootNodeOrdinal+1];edgeIndex<endEdgeIndex;edgeInd ex+=edgeFieldsCount){var edgeType=containmentEdges[edgeIndex+edgeTypeOffset];var nodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(edgeType===edgeElemen tType){node.nodeIndex=nodeIndex;if(!node.isDocumentDOMTreesRoot())
371 continue;}else if(edgeType!==edgeShortcutType) 434 continue;}else if(edgeType!==edgeShortcutType)
372 continue;var nodeOrdinal=nodeIndex/nodeFieldCount;nodesToVisit[nodesToVisitLengt h++]=nodeOrdinal;flags[nodeOrdinal]|=visitedMarker;} 435 continue;var nodeOrdinal=nodeIndex/nodeFieldCount;nodesToVisit[nodesToVisitLengt h++]=nodeOrdinal;flags[nodeOrdinal]|=visitedMarker;}
373 while(nodesToVisitLength){var nodeOrdinal=nodesToVisit[--nodesToVisitLength];fla gs[nodeOrdinal]|=flag;flags[nodeOrdinal]&=visitedMarkerMask;var beginEdgeIndex=f irstEdgeIndexes[nodeOrdinal];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];fo r(var edgeIndex=beginEdgeIndex;edgeIndex<endEdgeIndex;edgeIndex+=edgeFieldsCount ){var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var childNodeO rdinal=childNodeIndex/nodeFieldCount;if(flags[childNodeOrdinal]&markerAndFlag) 436 while(nodesToVisitLength){var nodeOrdinal=nodesToVisit[--nodesToVisitLength];fla gs[nodeOrdinal]|=flag;flags[nodeOrdinal]&=visitedMarkerMask;var beginEdgeIndex=f irstEdgeIndexes[nodeOrdinal];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];fo r(var edgeIndex=beginEdgeIndex;edgeIndex<endEdgeIndex;edgeIndex+=edgeFieldsCount ){var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var childNodeO rdinal=childNodeIndex/nodeFieldCount;if(flags[childNodeOrdinal]&markerAndFlag)
374 continue;var type=containmentEdges[edgeIndex+edgeTypeOffset];if(type===edgeWeakT ype) 437 continue;var type=containmentEdges[edgeIndex+edgeTypeOffset];if(type===edgeWeakT ype)
375 continue;nodesToVisit[nodesToVisitLength++]=childNodeOrdinal;flags[childNodeOrdi nal]|=visitedMarker;}}},__proto__:WebInspector.HeapSnapshot.prototype};WebInspec tor.JSHeapSnapshotNode=function(snapshot,nodeIndex) 438 continue;nodesToVisit[nodesToVisitLength++]=childNodeOrdinal;flags[childNodeOrdi nal]|=visitedMarker;}}},__proto__:WebInspector.HeapSnapshot.prototype};WebInspec tor.JSHeapSnapshotNode=function(snapshot,nodeIndex)
376 {WebInspector.HeapSnapshotNode.call(this,snapshot,nodeIndex)} 439 {WebInspector.HeapSnapshotNode.call(this,snapshot,nodeIndex)}
377 WebInspector.JSHeapSnapshotNode.prototype={canBeQueried:function() 440 WebInspector.JSHeapSnapshotNode.prototype={canBeQueried:function()
378 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node Flags.canBeQueried);},isUserObject:function() 441 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node Flags.canBeQueried);},isUserObject:function()
379 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node Flags.pageObject);},className:function() 442 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node Flags.pageObject);},name:function(){var snapshot=this._snapshot;if(this._type()= ==snapshot._nodeConsStringType){var string=snapshot._lazyStringCache[this.nodeIn dex];if(typeof string==="undefined"){string=this._consStringName();snapshot._laz yStringCache[this.nodeIndex]=string;}
443 return string;}
444 return WebInspector.HeapSnapshotNode.prototype.name.call(this);},_consStringName :function()
445 {var snapshot=this._snapshot;var consStringType=snapshot._nodeConsStringType;var edgeInternalType=snapshot._edgeInternalType;var edgeFieldsCount=snapshot._edgeF ieldsCount;var edgeToNodeOffset=snapshot._edgeToNodeOffset;var edgeTypeOffset=sn apshot._edgeTypeOffset;var edgeNameOffset=snapshot._edgeNameOffset;var strings=s napshot._strings;var edges=snapshot._containmentEdges;var firstEdgeIndexes=snaps hot._firstEdgeIndexes;var nodeFieldCount=snapshot._nodeFieldCount;var nodeTypeOf fset=snapshot._nodeTypeOffset;var nodeNameOffset=snapshot._nodeNameOffset;var no des=snapshot._nodes;var nodesStack=[];nodesStack.push(this.nodeIndex);var name=" ";while(nodesStack.length&&name.length<1024){var nodeIndex=nodesStack.pop();if(n odes[nodeIndex+nodeTypeOffset]!==consStringType){name+=strings[nodes[nodeIndex+n odeNameOffset]];continue;}
446 var nodeOrdinal=nodeIndex/nodeFieldCount;var beginEdgeIndex=firstEdgeIndexes[nod eOrdinal];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];var firstNodeIndex=0; var secondNodeIndex=0;for(var edgeIndex=beginEdgeIndex;edgeIndex<endEdgeIndex&&( !firstNodeIndex||!secondNodeIndex);edgeIndex+=edgeFieldsCount){var edgeType=edge s[edgeIndex+edgeTypeOffset];if(edgeType===edgeInternalType){var edgeName=strings [edges[edgeIndex+edgeNameOffset]];if(edgeName==="first")
447 firstNodeIndex=edges[edgeIndex+edgeToNodeOffset];else if(edgeName==="second")
448 secondNodeIndex=edges[edgeIndex+edgeToNodeOffset];}}
449 nodesStack.push(secondNodeIndex);nodesStack.push(firstNodeIndex);}
450 return name;},className:function()
380 {var type=this.type();switch(type){case"hidden":return"(system)";case"object":ca se"native":return this.name();case"code":return"(compiled code)";default:return" ("+type+")";}},classIndex:function() 451 {var type=this.type();switch(type){case"hidden":return"(system)";case"object":ca se"native":return this.name();case"code":return"(compiled code)";default:return" ("+type+")";}},classIndex:function()
381 {var snapshot=this._snapshot;var nodes=snapshot._nodes;var type=nodes[this.nodeI ndex+snapshot._nodeTypeOffset];;if(type===snapshot._nodeObjectType||type===snaps hot._nodeNativeType) 452 {var snapshot=this._snapshot;var nodes=snapshot._nodes;var type=nodes[this.nodeI ndex+snapshot._nodeTypeOffset];;if(type===snapshot._nodeObjectType||type===snaps hot._nodeNativeType)
382 return nodes[this.nodeIndex+snapshot._nodeNameOffset];return-1-type;},id:functio n() 453 return nodes[this.nodeIndex+snapshot._nodeNameOffset];return-1-type;},id:functio n()
383 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod eIdOffset];},isHidden:function() 454 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod eIdOffset];},isHidden:function()
384 {return this._type()===this._snapshot._nodeHiddenType;},isSynthetic:function() 455 {return this._type()===this._snapshot._nodeHiddenType;},isSynthetic:function()
385 {return this._type()===this._snapshot._nodeSyntheticType;},isUserRoot:function() 456 {return this._type()===this._snapshot._nodeSyntheticType;},isUserRoot:function()
386 {return!this.isSynthetic();},isDocumentDOMTreesRoot:function() 457 {return!this.isSynthetic();},isDocumentDOMTreesRoot:function()
387 {return this.isSynthetic()&&this.name()==="(Document DOM trees)";},serialize:fun ction() 458 {return this.isSynthetic()&&this.name()==="(Document DOM trees)";},serialize:fun ction()
388 {var result=WebInspector.HeapSnapshotNode.prototype.serialize.call(this);var fla gs=this._snapshot._flagsOfNode(this);if(flags&this._snapshot._nodeFlags.canBeQue ried) 459 {var result=WebInspector.HeapSnapshotNode.prototype.serialize.call(this);var fla gs=this._snapshot._flagsOfNode(this);if(flags&this._snapshot._nodeFlags.canBeQue ried)
389 result.canBeQueried=true;if(flags&this._snapshot._nodeFlags.detachedDOMTreeNode) 460 result.canBeQueried=true;if(flags&this._snapshot._nodeFlags.detachedDOMTreeNode)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 WebInspector.FileOutputStream=function() 537 WebInspector.FileOutputStream=function()
467 {} 538 {}
468 WebInspector.FileOutputStream.prototype={open:function(fileName,callback) 539 WebInspector.FileOutputStream.prototype={open:function(fileName,callback)
469 {this._closed=false;this._writeCallbacks=[];this._fileName=fileName;function cal lbackWrapper() 540 {this._closed=false;this._writeCallbacks=[];this._fileName=fileName;function cal lbackWrapper()
470 {WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventType s.SavedURL,callbackWrapper,this);WebInspector.fileManager.addEventListener(WebIn spector.FileManager.EventTypes.AppendedToURL,this._onAppendDone,this);callback(t his);} 541 {WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventType s.SavedURL,callbackWrapper,this);WebInspector.fileManager.addEventListener(WebIn spector.FileManager.EventTypes.AppendedToURL,this._onAppendDone,this);callback(t his);}
471 WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.Sa vedURL,callbackWrapper,this);WebInspector.fileManager.save(this._fileName,"",tru e);},write:function(data,callback) 542 WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.Sa vedURL,callbackWrapper,this);WebInspector.fileManager.save(this._fileName,"",tru e);},write:function(data,callback)
472 {this._writeCallbacks.push(callback);WebInspector.fileManager.append(this._fileN ame,data);},close:function() 543 {this._writeCallbacks.push(callback);WebInspector.fileManager.append(this._fileN ame,data);},close:function()
473 {this._closed=true;if(this._writeCallbacks.length) 544 {this._closed=true;if(this._writeCallbacks.length)
474 return;WebInspector.fileManager.removeEventListener(WebInspector.FileManager.Eve ntTypes.AppendedToURL,this._onAppendDone,this);WebInspector.fileManager.close(th is._fileName);},_onAppendDone:function(event) 545 return;WebInspector.fileManager.removeEventListener(WebInspector.FileManager.Eve ntTypes.AppendedToURL,this._onAppendDone,this);WebInspector.fileManager.close(th is._fileName);},_onAppendDone:function(event)
475 {if(event.data!==this._fileName) 546 {if(event.data!==this._fileName)
476 return;if(!this._writeCallbacks.length){if(this._closed){WebInspector.fileManage r.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL,this._on AppendDone,this);WebInspector.fileManager.close(this._fileName);} 547 return;var callback=this._writeCallbacks.shift();if(callback)
477 return;} 548 callback(this);if(!this._writeCallbacks.length){if(this._closed){WebInspector.fi leManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._onAppendDone,this);WebInspector.fileManager.close(this._fileName);}}}};Web Inspector.UIString=function(string,vararg)
478 var callback=this._writeCallbacks.shift();if(callback) 549 {return String.vsprintf(string,Array.prototype.slice.call(arguments,1));};Object .isEmpty=function(obj)
479 callback(this);}};Object.isEmpty=function(obj)
480 {for(var i in obj) 550 {for(var i in obj)
481 return false;return true;} 551 return false;return true;}
482 Object.values=function(obj) 552 Object.values=function(obj)
483 {var result=Object.keys(obj);var length=result.length;for(var i=0;i<length;++i) 553 {var result=Object.keys(obj);var length=result.length;for(var i=0;i<length;++i)
484 result[i]=obj[result[i]];return result;} 554 result[i]=obj[result[i]];return result;}
485 String.prototype.findAll=function(string) 555 String.prototype.findAll=function(string)
486 {var matches=[];var i=this.indexOf(string);while(i!==-1){matches.push(i);i=this. indexOf(string,i+string.length);} 556 {var matches=[];var i=this.indexOf(string);while(i!==-1){matches.push(i);i=this. indexOf(string,i+string.length);}
487 return matches;} 557 return matches;}
488 String.prototype.lineEndings=function() 558 String.prototype.lineEndings=function()
489 {if(!this._lineEndings){this._lineEndings=this.findAll("\n");this._lineEndings.p ush(this.length);} 559 {if(!this._lineEndings){this._lineEndings=this.findAll("\n");this._lineEndings.p ush(this.length);}
(...skipping 21 matching lines...) Expand all
511 String.prototype.trimURL=function(baseURLDomain) 581 String.prototype.trimURL=function(baseURLDomain)
512 {var result=this.replace(/^(https|http|file):\/\//i,"");if(baseURLDomain) 582 {var result=this.replace(/^(https|http|file):\/\//i,"");if(baseURLDomain)
513 result=result.replace(new RegExp("^"+baseURLDomain.escapeForRegExp(),"i"),"");re turn result;} 583 result=result.replace(new RegExp("^"+baseURLDomain.escapeForRegExp(),"i"),"");re turn result;}
514 String.prototype.toTitleCase=function() 584 String.prototype.toTitleCase=function()
515 {return this.substring(0,1).toUpperCase()+this.substring(1);} 585 {return this.substring(0,1).toUpperCase()+this.substring(1);}
516 String.prototype.compareTo=function(other) 586 String.prototype.compareTo=function(other)
517 {if(this>other) 587 {if(this>other)
518 return 1;if(this<other) 588 return 1;if(this<other)
519 return-1;return 0;} 589 return-1;return 0;}
520 function sanitizeHref(href) 590 function sanitizeHref(href)
521 {return href&&href.trim().toLowerCase().startsWith("javascript:")?"":href;} 591 {return href&&href.trim().toLowerCase().startsWith("javascript:")?null:href;}
522 String.prototype.removeURLFragment=function() 592 String.prototype.removeURLFragment=function()
523 {var fragmentIndex=this.indexOf("#");if(fragmentIndex==-1) 593 {var fragmentIndex=this.indexOf("#");if(fragmentIndex==-1)
524 fragmentIndex=this.length;return this.substring(0,fragmentIndex);} 594 fragmentIndex=this.length;return this.substring(0,fragmentIndex);}
525 String.prototype.startsWith=function(substring) 595 String.prototype.startsWith=function(substring)
526 {return!this.lastIndexOf(substring,0);} 596 {return!this.lastIndexOf(substring,0);}
527 String.prototype.endsWith=function(substring) 597 String.prototype.endsWith=function(substring)
528 {return this.indexOf(substring,this.length-substring.length)!==-1;} 598 {return this.indexOf(substring,this.length-substring.length)!==-1;}
529 String.naturalOrderComparator=function(a,b) 599 String.naturalOrderComparator=function(a,b)
530 {var chunk=/^\d+|^\D+/;var chunka,chunkb,anum,bnum;while(1){if(a){if(!b) 600 {var chunk=/^\d+|^\D+/;var chunka,chunkb,anum,bnum;while(1){if(a){if(!b)
531 return 1;}else{if(b) 601 return 1;}else{if(b)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 this.splice(index,1);return;} 633 this.splice(index,1);return;}
564 var length=this.length;for(var i=0;i<length;++i){if(this[i]===value) 634 var length=this.length;for(var i=0;i<length;++i){if(this[i]===value)
565 this.splice(i,1);}}});Object.defineProperty(Array.prototype,"keySet",{value:func tion() 635 this.splice(i,1);}}});Object.defineProperty(Array.prototype,"keySet",{value:func tion()
566 {var keys={};for(var i=0;i<this.length;++i) 636 {var keys={};for(var i=0;i<this.length;++i)
567 keys[this[i]]=true;return keys;}});Object.defineProperty(Array.prototype,"rotate ",{value:function(index) 637 keys[this[i]]=true;return keys;}});Object.defineProperty(Array.prototype,"rotate ",{value:function(index)
568 {var result=[];for(var i=index;i<index+this.length;++i) 638 {var result=[];for(var i=index;i<index+this.length;++i)
569 result.push(this[i%this.length]);return result;}});Object.defineProperty(Uint32A rray.prototype,"sort",{value:Array.prototype.sort});(function(){var partition={v alue:function(comparator,left,right,pivotIndex) 639 result.push(this[i%this.length]);return result;}});Object.defineProperty(Uint32A rray.prototype,"sort",{value:Array.prototype.sort});(function(){var partition={v alue:function(comparator,left,right,pivotIndex)
570 {function swap(array,i1,i2) 640 {function swap(array,i1,i2)
571 {var temp=array[i1];array[i1]=array[i2];array[i2]=temp;} 641 {var temp=array[i1];array[i1]=array[i2];array[i2]=temp;}
572 var pivotValue=this[pivotIndex];swap(this,right,pivotIndex);var storeIndex=left; for(var i=left;i<right;++i){if(comparator(this[i],pivotValue)<0){swap(this,store Index,i);++storeIndex;}} 642 var pivotValue=this[pivotIndex];swap(this,right,pivotIndex);var storeIndex=left; for(var i=left;i<right;++i){if(comparator(this[i],pivotValue)<0){swap(this,store Index,i);++storeIndex;}}
573 swap(this,right,storeIndex);return storeIndex;}};Object.defineProperty(Array.pro totype,"partition",partition);Object.defineProperty(Uint32Array.prototype,"parti tion",partition);var sortRange={value:function(comparator,leftBound,rightBound,k ) 643 swap(this,right,storeIndex);return storeIndex;}};Object.defineProperty(Array.pro totype,"partition",partition);Object.defineProperty(Uint32Array.prototype,"parti tion",partition);var sortRange={value:function(comparator,leftBound,rightBound,s ortWindowLeft,sortWindowRight)
574 {function quickSortFirstK(array,comparator,left,right,k) 644 {function quickSortRange(array,comparator,left,right,sortWindowLeft,sortWindowRi ght)
575 {if(right<=left) 645 {if(right<=left)
576 return;var pivotIndex=Math.floor(Math.random()*(right-left))+left;var pivotNewIn dex=array.partition(comparator,left,right,pivotIndex);quickSortFirstK(array,comp arator,left,pivotNewIndex-1,k);if(pivotNewIndex<left+k-1) 646 return;var pivotIndex=Math.floor(Math.random()*(right-left))+left;var pivotNewIn dex=array.partition(comparator,left,right,pivotIndex);if(sortWindowLeft<pivotNew Index)
577 quickSortFirstK(array,comparator,pivotNewIndex+1,right,left+k-1-pivotNewIndex);} 647 quickSortRange(array,comparator,left,pivotNewIndex-1,sortWindowLeft,sortWindowRi ght);if(pivotNewIndex<sortWindowRight)
578 if(leftBound===0&&rightBound===(this.length-1)&&k>=this.length) 648 quickSortRange(array,comparator,pivotNewIndex+1,right,sortWindowLeft,sortWindowR ight);}
649 if(leftBound===0&&rightBound===(this.length-1)&&sortWindowLeft===0&&sortWindowRi ght>=rightBound)
579 this.sort(comparator);else 650 this.sort(comparator);else
580 quickSortFirstK(this,comparator,leftBound,rightBound,k);return this;}} 651 quickSortRange(this,comparator,leftBound,rightBound,sortWindowLeft,sortWindowRig ht);return this;}}
581 Object.defineProperty(Array.prototype,"sortRange",sortRange);Object.defineProper ty(Uint32Array.prototype,"sortRange",sortRange);})();Object.defineProperty(Array .prototype,"qselect",{value:function(k,comparator) 652 Object.defineProperty(Array.prototype,"sortRange",sortRange);Object.defineProper ty(Uint32Array.prototype,"sortRange",sortRange);})();Object.defineProperty(Array .prototype,"qselect",{value:function(k,comparator)
582 {if(k<0||k>=this.length) 653 {if(k<0||k>=this.length)
583 return;if(!comparator) 654 return;if(!comparator)
584 comparator=function(a,b){return a-b;} 655 comparator=function(a,b){return a-b;}
585 var low=0;var high=this.length-1;for(;;){var pivotPosition=this.partition(compar ator,low,high,Math.floor((high+low)/2));if(pivotPosition===k) 656 var low=0;var high=this.length-1;for(;;){var pivotPosition=this.partition(compar ator,low,high,Math.floor((high+low)/2));if(pivotPosition===k)
586 return this[k];else if(pivotPosition>k) 657 return this[k];else if(pivotPosition>k)
587 high=pivotPosition-1;else 658 high=pivotPosition-1;else
588 low=pivotPosition+1;}}});Object.defineProperty(Array.prototype,"lowerBound",{val ue:function(object,comparator) 659 low=pivotPosition+1;}}});Object.defineProperty(Array.prototype,"lowerBound",{val ue:function(object,comparator)
589 {function defaultComparator(a,b) 660 {function defaultComparator(a,b)
590 {return a<b?-1:(a>b?1:0);} 661 {return a<b?-1:(a>b?1:0);}
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 StringPool.prototype={intern:function(string) 797 StringPool.prototype={intern:function(string)
727 {if(string==="__proto__") 798 {if(string==="__proto__")
728 return"__proto__";var result=this._strings[string];if(result===undefined){this._ strings[string]=string;result=string;} 799 return"__proto__";var result=this._strings[string];if(result===undefined){this._ strings[string]=string;result=string;}
729 return result;},reset:function() 800 return result;},reset:function()
730 {this._strings=Object.create(null);},internObjectStrings:function(obj,depthLimit ) 801 {this._strings=Object.create(null);},internObjectStrings:function(obj,depthLimit )
731 {if(typeof depthLimit!=="number") 802 {if(typeof depthLimit!=="number")
732 depthLimit=100;else if(--depthLimit<0) 803 depthLimit=100;else if(--depthLimit<0)
733 throw"recursion depth limit reached in StringPool.deepIntern(), perhaps attempti ng to traverse cyclical references?";for(var field in obj){switch(typeof obj[fie ld]){case"string":obj[field]=this.intern(obj[field]);break;case"object":this.int ernObjectStrings(obj[field],depthLimit);break;}}}} 804 throw"recursion depth limit reached in StringPool.deepIntern(), perhaps attempti ng to traverse cyclical references?";for(var field in obj){switch(typeof obj[fie ld]){case"string":obj[field]=this.intern(obj[field]);break;case"object":this.int ernObjectStrings(obj[field],depthLimit);break;}}}}
734 var _importedScripts={};function importScript(scriptName) 805 var _importedScripts={};function importScript(scriptName)
735 {if(_importedScripts[scriptName]) 806 {if(_importedScripts[scriptName])
736 return;var xhr=new XMLHttpRequest();_importedScripts[scriptName]=true;if(window. flattenImports) 807 return;var xhr=new XMLHttpRequest();_importedScripts[scriptName]=true;xhr.open(" GET",scriptName,false);xhr.send(null);if(!xhr.responseText)
737 scriptName=scriptName.split("/").reverse()[0];xhr.open("GET",scriptName,false);x hr.send(null);if(!xhr.responseText)
738 throw"empty response arrived for script '"+scriptName+"'";var sourceURL=WebInspe ctor.ParsedURL.completeURL(window.location.href,scriptName);window.eval(xhr.resp onseText+"\n//# sourceURL="+sourceURL);} 808 throw"empty response arrived for script '"+scriptName+"'";var sourceURL=WebInspe ctor.ParsedURL.completeURL(window.location.href,scriptName);window.eval(xhr.resp onseText+"\n//# sourceURL="+sourceURL);}
739 var loadScript=importScript;function CallbackBarrier() 809 var loadScript=importScript;function CallbackBarrier()
740 {this._pendingIncomingCallbacksCount=0;} 810 {this._pendingIncomingCallbacksCount=0;}
741 CallbackBarrier.prototype={createCallback:function(userCallback) 811 CallbackBarrier.prototype={createCallback:function(userCallback)
742 {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is cal led after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount ;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(c allback) 812 {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is cal led after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount ;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(c allback)
743 {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is calle d multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCall backsCount) 813 {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is calle d multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCall backsCount)
744 this._outgoingCallback();},_incomingCallback:function(userCallback) 814 this._outgoingCallback();},_incomingCallback:function(userCallback)
745 {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args =Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);} 815 {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args =Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);}
746 if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback) 816 if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback)
747 this._outgoingCallback();}};function postMessageWrapper(message) 817 this._outgoingCallback();}};function postMessageWrapper(message)
748 {postMessage(message);} 818 {postMessage(message);}
749 WebInspector.WorkerConsole=function() 819 var dispatcher=new WebInspector.HeapSnapshotWorkerDispatcher(this,postMessageWra pper);addEventListener("message",dispatcher.dispatchMessage.bind(dispatcher),fal se);
750 {}
751 WebInspector.WorkerConsole.prototype={log:function(var_args)
752 {this._postMessage("log",Array.prototype.slice.call(arguments));},error:function (var_args)
753 {this._postMessage("error",Array.prototype.slice.call(arguments));},info:functio n(var_args)
754 {this._postMessage("info",Array.prototype.slice.call(arguments));},trace:functio n()
755 {this.log(new Error().stack);},_postMessage:function(method,args)
756 {var rawMessage={object:"console",method:method,arguments:args};postMessageWrapp er(rawMessage);}};var dispatcher=new WebInspector.HeapSnapshotWorkerDispatcher(t his,postMessageWrapper);addEventListener("message",dispatcher.dispatchMessage.bi nd(dispatcher),false);console=new WebInspector.WorkerConsole();
OLDNEW
« no previous file with comments | « chrome_linux/resources/inspector/ElementsPanel.js ('k') | chrome_linux/resources/inspector/Images/navigationControls.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698