Home | History | Annotate | Download | only in chromium-trace

Lines Matching refs:snapshots

159 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){this.parent=b;this.id=a;this.category=c;this.name=e;this.creationTs=f;this.creationTsWasExplicit=!1;this.deletionTs=Number.MAX_VALUE;this.selected=this.deletionTsWasExplicit=!1;this.colorId=0;this.bounds=new base.Range;this.snapshots=[];this.hasImplicitSnapshots=!1}d.prototype={__proto__:Object.prototype,get typeName(){return this.name},addSnapshot:function(b,a){if(b<this.creationTs)throw Error("Snapshots must be >= instance.creationTs");
160 if(b>=this.deletionTs)throw Error("Snapshots cannot be added after an objects deletion timestamp.");var c;if(0<this.snapshots.length){c=this.snapshots[this.snapshots.length-1];if(c.ts==b)throw Error("Snapshots already exists at this time!");if(b<c.ts)throw Error("Snapshots must be added in increasing timestamp order");}c=new (tracing.trace_model.ObjectSnapshot.getConstructor(this.name))(this,b,a);this.snapshots.push(c);return c},wasDeleted:function(b){var a;if(0<this.snapshots.length&&(a=this.snapshots[this.snapshots.length-
161 1],a.ts>b))throw Error("Instance cannot be deleted at ts="+b+". A snapshot exists that is older.");this.deletionTs=b;this.deletionTsWasExplicit=!0},preInitialize:function(){for(var b=0;b<this.snapshots.length;b++)this.snapshots[b].preInitialize()},initialize:function(){for(var b=0;b<this.snapshots.length;b++)this.snapshots[b].initialize()},getSnapshotAt:function(b){if(b<this.creationTs){if(this.creationTsWasExplicit)throw Error("ts must be within lifetime of this instance");return this.snapshots[0]}if(b>
162 this.deletionTs)throw Error("ts must be within lifetime of this instance");var a=this.snapshots;b=base.findLowIndexInSortedIntervals(a,function(a){return a.ts},function(c,b){return b==a.length-1?a[b].objectInstance.deletionTs:a[b+1].ts-a[b].ts},b);return 0>b?this.snapshots[0]:b>=this.snapshots.length?this.snapshots[this.snapshots.length-1]:this.snapshots[b]},updateBounds:function(){this.bounds.reset();this.bounds.addValue(this.creationTs);this.deletionTs!=Number.MAX_VALUE?this.bounds.addValue(this.deletionTs):
163 0<this.snapshots.length&&this.bounds.addValue(this.snapshots[this.snapshots.length-1].ts)},shiftTimestampsForward:function(b){this.creationTs+=b;this.deletionTs!=Number.MAX_VALUE&&(this.deletionTs+=b);this.snapshots.forEach(function(a){a.ts+=b})}};d.nameToConstructorMap_={};d.register=function(b,a){if(d.nameToConstructorMap_[b])throw Error("Constructor already registerd for "+b);d.nameToConstructorMap_[b]=a};d.unregister=function(b){delete d.nameToConstructorMap_[b]};d.getConstructor=function(b){return d.nameToConstructorMap_[b]?
167 if(0!=f.snapshots.length)throw Error("Cannot shift creationTs forward, snapshots have been added. First snap was at ts="+f.snapshots[0].ts+" and creationTs was "+f.creationTs);f.creationTs=c}else if(f>=this.instances.length)if(f=this.instances[this.instances.length-1],c>=f.deletionTs)f=this.createObjectInstanceFunction_(this.parent,this.id,b,a,c),this.instances.push(f);else{for(var g,f=this.instances.length-1;0<=f;f--){b=this.instances[f];if(c>=b.deletionTs)break;0==b.creationTsWasExplicit&&0==b.snapshots.length&&
266 Snapshots must have args: {snapshot: ...}");return}var d;try{d=a.objects.addSnapshot(c.id,c.cat,c.name,b,this.deepCopyIfNeeded_(c.args.snapshot))}catch(g){this.model_.importErrors.push("While processing snapshot of "+
268 createImplicitObjects_:function(){base.iterItems(this.model_.processes,function(a,c){this.createImplicitObjectsForProcess_(c)},this)},createImplicitObjectsForProcess_:function(a){function c(c,b,e,d){if(e&&void 0!==e.id&&!(e instanceof tracing.trace_model.ObjectSnapshot)){var l=e.id,m=/(.+)\/(.+)/.exec(l);if(!m)throw Error("Implicit snapshots must have names.");delete e.id;var n=m[1],m=m[2],p;try{p=a.objects.addSnapshot(m,d.objectInstance.category,n,d.ts,e)}catch(q){this.model_.importErrors.push("While processing implicit snapshot of "+
269 l+" at ts="+d.ts+": "+q);return}p.objectInstance.hasImplicitSnapshots=!0;p.containingSnapshot=d;c[b]=p;if(!(p instanceof tracing.trace_model.ObjectSnapshot))throw Error("Created object must be instanceof snapshot");return p.args}}function b(a,c,d,k){if(a instanceof Object)if(a instanceof Array)for(var l=0;l<a.length;l++){var m=c.call(k,a,l,a[l],d);m?b(m,c,d,k):b(a[l],c,d,k)}else for(l in a)(m=c.call(k,a,l,a[l],d))?b(m,c,d,k):b(a[l],c,d,k)}a.objects.iterObjectInstances(function(a){a.snapshots.forEach(function(a){if(void 0!==
271 this);a.objects.iterObjectInstances(function(b){b.snapshots.forEach(function(b){this.searchItemForIDRefs_(c,a.objects,"ts",b)},this)},this);c.forEach(function(a){a.object[a.field]=a.value})},searchItemForIDRefs_:function(a,c,b,f){function d(g,h,m){void 0!==m&&(m.id_ref||m.idRef)&&(m=c.getSnapshotAt(m.id_ref||m.idRef,f[b]))&&a.push({object:g,field:h,value:m})}function h(a){if(a instanceof Object&&!(a instanceof tracing.trace_model.ObjectSnapshot||a instanceof Float32Array||a instanceof base.Quad))if(a instanceof
343 b+='<tr><td>snapshots:</td><td id="snapshots"></td></tr>\n';this.innerHTML=b+="</table>";var d=this.querySelector("#snapshots");a.snapshots.forEach(function(a){var c=new tracing.analysis.ObjectSnapshotLink;c.objectSnapshot=a;d.appendChild(c)})}else this.textContent=""}};return{DefaultObjectSnapshotView:b,DefaultObjectInstanceView:a}});"use strict";base.require("ui");
427 a.length?(this.heading=a[0].typeName,this.objectInstances_=a,this.objectSnapshots_=[],this.objectInstances_.forEach(function(a){this.objectSnapshots_.push.apply(this.objectSnapshots_,a.snapshots)},this)):(this.heading="",this.objectInstances_=[],this.objectSnapshots_=[])},get height(){return window.getComputedStyle(this).height},set height(a){this.style.height=a},get snapshotRadiusView(){return 7*(window.devicePixelRatio||1)},draw:function(a,b,d){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,
435 this.computeMaxBytes_(this.objectInstance_.snapshots)}else this.objectInstance_=[]},computeMaxBytes_:function(a){for(var b=0,d=0;d<a.length;d++){for(var g=a[d],h=Object.keys(g.heap_.children),k=0,l=0;l<h.length;l++)k+=g.heap_.children[h[l]].currentBytes;k>b&&(b=k)}return b},get height(){return window.getComputedStyle(this).height},set height(a){this.style.height=a},draw:function(a,b,d){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,d)}},drawSlices_:function(a,e){var f=this.context(),
436 g=window.devicePixelRatio||1,h=this.getBoundingClientRect(),k=h.width*g,g=h.height*g,h=this.viewport,l=this.maxBytes_,m=this.objectInstance_.snapshots,n=base.findLowIndexInSortedArray(m,function(a){return a.ts},a);for(0<n&&--n;n<m.length;++n){var p=m[n],q=p.ts;if(q>e)break;q=h.xWorldToView(q);0>q&&(q=0);var s=h.xWorldToView(n<m.length-1?m[n+1].ts:m[m.length-1].ts+5E3);s>k&&(s=k);for(var q=Math.floor(q),s=Math.floor(s),u=g,w=Object.keys(p.heap_.children),t=w.length-1;0<=t;t--){var r=p.heap_.children[w[t]];
437 f.fillStyle=this.objectInstance_.selectedTraces&&0<this.objectInstance_.selectedTraces.length&&this.objectInstance_.selectedTraces[0]==w[t]?"rgb(239, 248, 206)":d[(p.selected?p.objectInstance.colorId+b:p.objectInstance.colorId)+t];r=g*r.currentBytes/l;f.fillRect(q,u-r,Math.max(s-q,1),r);u-=r}}f.lineWidth=1},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,b,d,g){var h=this;base.iterateOverIntersectingIntervals(this.objectInstance_.snapshots,function(a){return a.ts},function(a){return 5E3},
438 a,b,function(a){g.addObjectSnapshot(h,a)})},addItemNearToProvidedHitToSelection:function(a,b,d){if(a instanceof tracing.SelectionObjectSnapshotHit){var g=this.objectInstance_.snapshots;a=g.indexOf(a.objectSnapshot)+b;if(0<=a&&a<g.length)return d.addObjectSnapshot(this,g[a]),!0}else throw Error("Unrecognized hit");return!1},addAllObjectsMatchingFilterToSelection:function(a,b){}};tracing.tracks.ObjectInstanceTrack.register("memory::Heap",a);return{HeapInstanceTrack:a}});"use strict";base.requireStylesheet("tracing.tracks.counter_track");
467 this.appendThreadTracks_(),this.didAppendTracks_())},willAppendTracks_:function(){},didAppendTracks_:function(){},appendObjectInstanceTracks_:function(){var a=this.processBase_.objects.getAllInstancesByTypeName(),e=base.dictionaryKeys(a);e.sort();var h=!1;e.forEach(function(c){var e=a[c],g=b.getViewInfo(c),n=d.getViewInfo(c);g&&!g.options.showInTrackView&&(g=void 0);n&&!n.options.showInTrackView&&(n=void 0);for(var n=g||n,g=[],p=0;p<e.length;p++){var q=e[p];0!==q.snapshots.length&&(q.hasImplicitSnapshots&&