| Index: chrome_linux/resources/inspector/TimelinePanel.js
|
| ===================================================================
|
| --- chrome_linux/resources/inspector/TimelinePanel.js (revision 229864)
|
| +++ chrome_linux/resources/inspector/TimelinePanel.js (working copy)
|
| @@ -114,7 +114,7 @@
|
| ctx.lineTo(width,currentY);ctx.lineWidth=1;ctx.strokeStyle=counterUI.graphColor;ctx.stroke();ctx.closePath();},_discardImageUnderMarker:function()
|
| {for(var i=0;i<this._counterUI.length;i++)
|
| this._counterUI[i].discardImageUnderMarker();},__proto__:WebInspector.MemoryStatistics.prototype};WebInspector.TimelineModel=function()
|
| -{this._records=[];this._stringPool=new StringPool();this._minimumRecordTime=-1;this._maximumRecordTime=-1;this._collectionEnabled=false;WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded,this._onRecordAdded,this);}
|
| +{this._records=[];this._stringPool=new StringPool();this._minimumRecordTime=-1;this._maximumRecordTime=-1;this._collectionEnabled=false;WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded,this._onRecordAdded,this);WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStartEvent,this._onTimelineStarted,this);}
|
| WebInspector.TimelineModel.TransferChunkLengthBytes=5000000;WebInspector.TimelineModel.RecordType={Root:"Root",Program:"Program",EventDispatch:"EventDispatch",BeginFrame:"BeginFrame",ScheduleStyleRecalculation:"ScheduleStyleRecalculation",RecalculateStyles:"RecalculateStyles",InvalidateLayout:"InvalidateLayout",Layout:"Layout",PaintSetup:"PaintSetup",Paint:"Paint",Rasterize:"Rasterize",ScrollLayer:"ScrollLayer",DecodeImage:"DecodeImage",ResizeImage:"ResizeImage",CompositeLayers:"CompositeLayers",ParseHTML:"ParseHTML",TimerInstall:"TimerInstall",TimerRemove:"TimerRemove",TimerFire:"TimerFire",XHRReadyStateChange:"XHRReadyStateChange",XHRLoad:"XHRLoad",EvaluateScript:"EvaluateScript",MarkLoad:"MarkLoad",MarkDOMContent:"MarkDOMContent",TimeStamp:"TimeStamp",Time:"Time",TimeEnd:"TimeEnd",ScheduleResourceRequest:"ScheduleResourceRequest",ResourceSendRequest:"ResourceSendRequest",ResourceReceiveResponse:"ResourceReceiveResponse",ResourceReceivedData:"ResourceReceivedData",ResourceFinish:"ResourceFinish",FunctionCall:"FunctionCall",GCEvent:"GCEvent",RequestAnimationFrame:"RequestAnimationFrame",CancelAnimationFrame:"CancelAnimationFrame",FireAnimationFrame:"FireAnimationFrame",WebSocketCreate:"WebSocketCreate",WebSocketSendHandshakeRequest:"WebSocketSendHandshakeRequest",WebSocketReceiveHandshakeResponse:"WebSocketReceiveHandshakeResponse",WebSocketDestroy:"WebSocketDestroy",}
|
| WebInspector.TimelineModel.Events={RecordAdded:"RecordAdded",RecordsCleared:"RecordsCleared"}
|
| WebInspector.TimelineModel.startTimeInSeconds=function(record)
|
| @@ -150,7 +150,10 @@
|
| {return this._maximumRecordTime;},_updateBoundaries:function(record)
|
| {var startTime=WebInspector.TimelineModel.startTimeInSeconds(record);var endTime=WebInspector.TimelineModel.endTimeInSeconds(record);if(this._minimumRecordTime===-1||startTime<this._minimumRecordTime)
|
| this._minimumRecordTime=startTime;if(this._maximumRecordTime===-1||endTime>this._maximumRecordTime)
|
| -this._maximumRecordTime=endTime;},recordOffsetInSeconds:function(rawRecord)
|
| +this._maximumRecordTime=endTime;},_onTimelineStarted:function(event)
|
| +{if(event.data.timestampsBase)
|
| +this._timestampsBase=event.data.timestampsBase;if(event.data.startTime)
|
| +this._startTime=event.data.startTime;},recordOffsetInSeconds:function(rawRecord)
|
| {return WebInspector.TimelineModel.startTimeInSeconds(rawRecord)-this._minimumRecordTime;},__proto__:WebInspector.Object.prototype}
|
| WebInspector.TimelineModelLoader=function(model,reader,progress)
|
| {this._model=model;this._reader=reader;this._progress=progress;this._buffer="";this._firstChunk=true;}
|
| @@ -340,8 +343,9 @@
|
| eventDivider.title=title;return eventDivider;}
|
| WebInspector.TimelinePresentationModel._hiddenRecords={}
|
| WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.MarkDOMContent]=1;WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.MarkLoad]=1;WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.ScheduleStyleRecalculation]=1;WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.InvalidateLayout]=1;WebInspector.TimelinePresentationModel.prototype={addFilter:function(filter)
|
| -{this._filters.push(filter);},setSearchFilter:function(filter)
|
| -{this._searchFilter=filter;},rootRecord:function()
|
| +{this._filters.push(filter);},removeFilter:function(filter)
|
| +{var index=this._filters.indexOf(filter);if(index!==-1)
|
| +this._filters.splice(index,1);},rootRecord:function()
|
| {return this._rootRecord;},frames:function()
|
| {return this._frames;},reset:function()
|
| {this._linkifier.reset();this._rootRecord=new WebInspector.TimelinePresentationModel.Record(this,{type:WebInspector.TimelineModel.RecordType.Root},null,null,null,false);this._sendRequestRecords={};this._scheduledResourceRequests={};this._timerRecords={};this._requestAnimationFrameRecords={};this._eventDividerRecords=[];this._timeRecords={};this._timeRecordStack=[];this._frames=[];this._minimumRecordTime=-1;this._layoutInvalidateStack={};this._lastScheduleStyleRecalculation={};this._webSocketCreateRecords={};this._coalescingBuckets={};},addFrame:function(frame)
|
| @@ -384,11 +388,10 @@
|
| {this._glueRecords=glue;},invalidateFilteredRecords:function()
|
| {delete this._filteredRecords;},filteredRecords:function()
|
| {if(this._filteredRecords)
|
| -return this._filteredRecords;var recordsInWindow=[];var stack=[{children:this._rootRecord.children,index:0,parentIsCollapsed:false,parentRecord:{}}];var revealedDepth=0;function revealRecordsInStack(){for(var depth=revealedDepth+1;depth<stack.length;++depth){if(stack[depth-1].parentIsCollapsed){stack[depth].parentRecord.parent._expandable=true;return;}
|
| -stack[depth-1].parentRecord.collapsed=false;recordsInWindow.push(stack[depth].parentRecord);stack[depth].windowLengthBeforeChildrenTraversal=recordsInWindow.length;stack[depth].parentIsRevealed=true;revealedDepth=depth;}}
|
| -while(stack.length){var entry=stack[stack.length-1];var records=entry.children;if(records&&entry.index<records.length){var record=records[entry.index];++entry.index;if(this.isVisible(record)){record.parent._expandable=true;if(this._searchFilter)
|
| -revealRecordsInStack();if(!entry.parentIsCollapsed){recordsInWindow.push(record);revealedDepth=stack.length;entry.parentRecord.collapsed=false;}}
|
| -record._expandable=false;stack.push({children:record.children,index:0,parentIsCollapsed:(entry.parentIsCollapsed||(record.collapsed&&(!this._searchFilter||record.clicked))),parentRecord:record,windowLengthBeforeChildrenTraversal:recordsInWindow.length});}else{stack.pop();revealedDepth=Math.min(revealedDepth,stack.length-1);entry.parentRecord._visibleChildrenCount=recordsInWindow.length-entry.windowLengthBeforeChildrenTraversal;}}
|
| +return this._filteredRecords;var recordsInWindow=[];var stack=[{children:this._rootRecord.children,index:0,parentIsCollapsed:false}];while(stack.length){var entry=stack[stack.length-1];var records=entry.children;if(records&&entry.index<records.length){var record=records[entry.index];++entry.index;if(this.isVisible(record)){++record.parent._invisibleChildrenCount;if(!entry.parentIsCollapsed)
|
| +recordsInWindow.push(record);}
|
| +record._invisibleChildrenCount=0;stack.push({children:record.children,index:0,parentIsCollapsed:(entry.parentIsCollapsed||record.collapsed),parentRecord:record,windowLengthBeforeChildrenTraversal:recordsInWindow.length});}else{stack.pop();if(entry.parentRecord)
|
| +entry.parentRecord._visibleChildrenCount=recordsInWindow.length-entry.windowLengthBeforeChildrenTraversal;}}
|
| this._filteredRecords=recordsInWindow;return recordsInWindow;},filteredFrames:function(startTime,endTime)
|
| {function compareStartTime(value,object)
|
| {return value-object.startTime;}
|
| @@ -399,7 +402,7 @@
|
| {return this._eventDividerRecords;},isVisible:function(record)
|
| {for(var i=0;i<this._filters.length;++i){if(!this._filters[i].accept(record))
|
| return false;}
|
| -return!this._searchFilter||this._searchFilter.accept(record);},generateMainThreadBarPopupContent:function(info)
|
| +return true;},generateMainThreadBarPopupContent:function(info)
|
| {var firstTaskIndex=info.firstTaskIndex;var lastTaskIndex=info.lastTaskIndex;var tasks=info.tasks;var messageCount=lastTaskIndex-firstTaskIndex+1;var cpuTime=0;for(var i=firstTaskIndex;i<=lastTaskIndex;++i){var task=tasks[i];cpuTime+=task.endTime-task.startTime;}
|
| var startTime=tasks[firstTaskIndex].startTime;var endTime=tasks[lastTaskIndex].endTime;var duration=endTime-startTime;var offset=this._minimumRecordTime;var contentHelper=new WebInspector.PopoverContentHelper(WebInspector.UIString("CPU"));var durationText=WebInspector.UIString("%s (at %s)",Number.secondsToString(duration,true),Number.secondsToString(startTime-offset,true));contentHelper.appendTextRow(WebInspector.UIString("Duration"),durationText);contentHelper.appendTextRow(WebInspector.UIString("CPU time"),Number.secondsToString(cpuTime,true));contentHelper.appendTextRow(WebInspector.UIString("Message Count"),messageCount);return contentHelper.contentTable();},__proto__:WebInspector.Object.prototype}
|
| WebInspector.TimelinePresentationModel.Record=function(presentationModel,record,parentRecord,origin,scriptDetails,hidden)
|
| @@ -409,8 +412,7 @@
|
| if(origin)
|
| this._origin=origin;this._selfTime=this.endTime-this.startTime;this._lastChildEndTime=this.endTime;this._startTimeOffset=this.startTime-presentationModel._minimumRecordTime;if(record.data){if(record.data["url"])
|
| this.url=record.data["url"];if(record.data["layerRootNode"])
|
| -this._relatedBackendNodeId=record.data["layerRootNode"];else if(record.data["elementId"])
|
| -this._relatedBackendNodeId=record.data["elementId"];}
|
| +this._relatedBackendNodeId=record.data["layerRootNode"];}
|
| if(scriptDetails){this.scriptName=scriptDetails.scriptName;this.scriptLine=scriptDetails.scriptLine;}
|
| if(parentRecord&&parentRecord.callSiteStackTrace)
|
| this.callSiteStackTrace=parentRecord.callSiteStackTrace;var recordTypes=WebInspector.TimelineModel.RecordType;switch(record.type){case recordTypes.ResourceSendRequest:presentationModel._sendRequestRecords[record.data["requestId"]]=this;break;case recordTypes.ScheduleResourceRequest:presentationModel._scheduledResourceRequests[record.data["url"]]=this;break;case recordTypes.ResourceReceiveResponse:var sendRequestRecord=presentationModel._sendRequestRecords[record.data["requestId"]];if(sendRequestRecord){this.url=sendRequestRecord.url;sendRequestRecord._refreshDetails();if(sendRequestRecord.parent!==presentationModel._rootRecord&&sendRequestRecord.parent.type===recordTypes.ScheduleResourceRequest)
|
| @@ -446,8 +448,8 @@
|
| {return this.type===WebInspector.TimelineModel.RecordType.Root;},origin:function()
|
| {return this._origin||this.parent;},get children()
|
| {return this._children;},get visibleChildrenCount()
|
| -{return this._visibleChildrenCount||0;},get expandable()
|
| -{return!!this._expandable;},get category()
|
| +{return this._visibleChildrenCount||0;},get invisibleChildrenCount()
|
| +{return this._invisibleChildrenCount||0;},get category()
|
| {return WebInspector.TimelinePresentationModel.recordStyle(this._record).category},get title()
|
| {return this.type===WebInspector.TimelineModel.RecordType.TimeStamp?this._record.data["message"]:WebInspector.TimelinePresentationModel.recordStyle(this._record).title;},get startTime()
|
| {return WebInspector.TimelineModel.startTimeInSeconds(this._record);},get endTime()
|
| @@ -482,9 +484,7 @@
|
| contentHelper.appendTextRow(WebInspector.UIString("Location"),WebInspector.UIString("(%d, %d)",this.data["x"],this.data["y"]));if(typeof this.data["width"]!=="undefined"&&typeof this.data["height"]!=="undefined")
|
| contentHelper.appendTextRow(WebInspector.UIString("Dimensions"),WebInspector.UIString("%d\u2009\u00d7\u2009%d",this.data["width"],this.data["height"]));}
|
| case recordTypes.PaintSetup:case recordTypes.Rasterize:case recordTypes.ScrollLayer:if(this._relatedNode)
|
| -contentHelper.appendElementRow(WebInspector.UIString("Layer root"),this._createNodeAnchor(this._relatedNode));break;case recordTypes.DecodeImage:case recordTypes.ResizeImage:if(this._relatedNode)
|
| -contentHelper.appendElementRow(WebInspector.UIString("Image element"),this._createNodeAnchor(this._relatedNode));if(this.url)
|
| -contentHelper.appendElementRow(WebInspector.UIString("Image URL"),WebInspector.linkifyResourceAsNode(this.url));break;case recordTypes.RecalculateStyles:if(this.data["elementCount"])
|
| +contentHelper.appendElementRow(WebInspector.UIString("Layer root"),this._createNodeAnchor(this._relatedNode));break;case recordTypes.RecalculateStyles:if(this.data["elementCount"])
|
| contentHelper.appendTextRow(WebInspector.UIString("Elements affected"),this.data["elementCount"]);callStackLabel=WebInspector.UIString("Styles recalculation forced");break;case recordTypes.Layout:if(this.data["dirtyObjects"])
|
| contentHelper.appendTextRow(WebInspector.UIString("Nodes that need layout"),this.data["dirtyObjects"]);if(this.data["totalObjects"])
|
| contentHelper.appendTextRow(WebInspector.UIString("Layout tree size"),this.data["totalObjects"]);if(typeof this.data["partialLayout"]==="boolean"){contentHelper.appendTextRow(WebInspector.UIString("Layout scope"),this.data["partialLayout"]?WebInspector.UIString("Partial"):WebInspector.UIString("Whole document"));}
|
| @@ -512,7 +512,7 @@
|
| {var node=document.createElement("span");node.textContent=textContent;return node;},_getRecordDetails:function()
|
| {var details;if(this.coalesced)
|
| return this._createSpanWithText(WebInspector.UIString("× %d",this.children.length));switch(this.type){case WebInspector.TimelineModel.RecordType.GCEvent:details=WebInspector.UIString("%s collected",Number.bytesToString(this.data["usedHeapSizeDelta"]));break;case WebInspector.TimelineModel.RecordType.TimerFire:details=this._linkifyScriptLocation(this.data["timerId"]);break;case WebInspector.TimelineModel.RecordType.FunctionCall:details=this._linkifyScriptLocation();break;case WebInspector.TimelineModel.RecordType.FireAnimationFrame:details=this._linkifyScriptLocation(this.data["id"]);break;case WebInspector.TimelineModel.RecordType.EventDispatch:details=this.data?this.data["type"]:null;break;case WebInspector.TimelineModel.RecordType.Paint:var width=this.data.clip?WebInspector.TimelinePresentationModel.quadWidth(this.data.clip):this.data.width;var height=this.data.clip?WebInspector.TimelinePresentationModel.quadHeight(this.data.clip):this.data.height;if(width&&height)
|
| -details=WebInspector.UIString("%d\u2009\u00d7\u2009%d",width,height);break;case WebInspector.TimelineModel.RecordType.TimerInstall:case WebInspector.TimelineModel.RecordType.TimerRemove:details=this._linkifyTopCallFrame(this.data["timerId"]);break;case WebInspector.TimelineModel.RecordType.RequestAnimationFrame:case WebInspector.TimelineModel.RecordType.CancelAnimationFrame:details=this._linkifyTopCallFrame(this.data["id"]);break;case WebInspector.TimelineModel.RecordType.ParseHTML:case WebInspector.TimelineModel.RecordType.RecalculateStyles:details=this._linkifyTopCallFrame();break;case WebInspector.TimelineModel.RecordType.EvaluateScript:details=this.url?this._linkifyLocation(this.url,this.data["lineNumber"],0):null;break;case WebInspector.TimelineModel.RecordType.XHRReadyStateChange:case WebInspector.TimelineModel.RecordType.XHRLoad:case WebInspector.TimelineModel.RecordType.ScheduleResourceRequest:case WebInspector.TimelineModel.RecordType.ResourceSendRequest:case WebInspector.TimelineModel.RecordType.ResourceReceivedData:case WebInspector.TimelineModel.RecordType.ResourceReceiveResponse:case WebInspector.TimelineModel.RecordType.ResourceFinish:case WebInspector.TimelineModel.RecordType.DecodeImage:case WebInspector.TimelineModel.RecordType.ResizeImage:details=WebInspector.displayNameForURL(this.url);break;case WebInspector.TimelineModel.RecordType.Time:case WebInspector.TimelineModel.RecordType.TimeEnd:details=this.data["message"];break;default:details=this._linkifyScriptLocation()||this._linkifyTopCallFrame()||null;break;}
|
| +details=WebInspector.UIString("%d\u2009\u00d7\u2009%d",width,height);break;case WebInspector.TimelineModel.RecordType.DecodeImage:details=this.data["imageType"];break;case WebInspector.TimelineModel.RecordType.ResizeImage:details=this.data["cached"]?WebInspector.UIString("cached"):WebInspector.UIString("non-cached");break;case WebInspector.TimelineModel.RecordType.TimerInstall:case WebInspector.TimelineModel.RecordType.TimerRemove:details=this._linkifyTopCallFrame(this.data["timerId"]);break;case WebInspector.TimelineModel.RecordType.RequestAnimationFrame:case WebInspector.TimelineModel.RecordType.CancelAnimationFrame:details=this._linkifyTopCallFrame(this.data["id"]);break;case WebInspector.TimelineModel.RecordType.ParseHTML:case WebInspector.TimelineModel.RecordType.RecalculateStyles:details=this._linkifyTopCallFrame();break;case WebInspector.TimelineModel.RecordType.EvaluateScript:details=this.url?this._linkifyLocation(this.url,this.data["lineNumber"],0):null;break;case WebInspector.TimelineModel.RecordType.XHRReadyStateChange:case WebInspector.TimelineModel.RecordType.XHRLoad:case WebInspector.TimelineModel.RecordType.ScheduleResourceRequest:case WebInspector.TimelineModel.RecordType.ResourceSendRequest:case WebInspector.TimelineModel.RecordType.ResourceReceivedData:case WebInspector.TimelineModel.RecordType.ResourceReceiveResponse:case WebInspector.TimelineModel.RecordType.ResourceFinish:details=WebInspector.displayNameForURL(this.url);break;case WebInspector.TimelineModel.RecordType.Time:case WebInspector.TimelineModel.RecordType.TimeEnd:details=this.data["message"];break;default:details=this._linkifyScriptLocation()||this._linkifyTopCallFrame()||null;break;}
|
| if(details){if(details instanceof Node)
|
| details.tabIndex=-1;else
|
| return this._createSpanWithText(""+details);}
|
| @@ -602,13 +602,14 @@
|
| {this._statusBarItems=([]);this.toggleTimelineButton=new WebInspector.StatusBarButton(WebInspector.UIString("Record"),"record-profile-status-bar-item");this.toggleTimelineButton.addEventListener("click",this._toggleTimelineButtonClicked,this);this._statusBarItems.push(this.toggleTimelineButton);this.clearButton=new WebInspector.StatusBarButton(WebInspector.UIString("Clear"),"clear-status-bar-item");this.clearButton.addEventListener("click",this._clearPanel,this);this._statusBarItems.push(this.clearButton);this.garbageCollectButton=new WebInspector.StatusBarButton(WebInspector.UIString("Collect Garbage"),"garbage-collect-status-bar-item");this.garbageCollectButton.addEventListener("click",this._garbageCollectButtonClicked,this);this._statusBarItems.push(this.garbageCollectButton);this._glueParentButton=new WebInspector.StatusBarButton(WebInspector.UIString("Glue asynchronous events to causes"),"glue-async-status-bar-item");this._glueParentButton.toggled=this._glueRecordsSetting.get();this._presentationModel.setGlueRecords(this._glueParentButton.toggled);this._glueParentButton.addEventListener("click",this._glueParentButtonClicked,this);this._statusBarItems.push(this._glueParentButton);this._durationFilterSelector=new WebInspector.StatusBarComboBox(this._durationFilterChanged.bind(this));for(var presetIndex=0;presetIndex<WebInspector.TimelinePanel.durationFilterPresetsMs.length;++presetIndex){var durationMs=WebInspector.TimelinePanel.durationFilterPresetsMs[presetIndex];var option=document.createElement("option");if(!durationMs){option.text=WebInspector.UIString("All");option.title=WebInspector.UIString("Show all records");}else{option.text=WebInspector.UIString("\u2265 %dms",durationMs);option.title=WebInspector.UIString("Hide records shorter than %dms",durationMs);}
|
| option._durationMs=durationMs;this._durationFilterSelector.addOption(option);this._durationFilterSelector.element.title=this._durationFilterSelector.selectedOption().title;}
|
| this._statusBarItems.push(this._durationFilterSelector);this._miscStatusBarItems=document.createElement("div");this._miscStatusBarItems.className="status-bar-items timeline-misc-status-bar-items";this._statusBarFilters=this._miscStatusBarItems.createChild("div","timeline-misc-status-bar-filters");var categories=WebInspector.TimelinePresentationModel.categories();for(var categoryName in categories){var category=categories[categoryName];if(category.overviewStripGroupIndex<0)
|
| -continue;this._statusBarFilters.appendChild(this._createTimelineCategoryStatusBarCheckbox(category));}
|
| -var statsContainer=this._statusBarFilters.createChild("div","timeline-records-stats-container");this.recordsCounter=statsContainer.createChild("div","timeline-records-stats");this.frameStatistics=statsContainer.createChild("div","timeline-records-stats hidden");function getAnchor()
|
| +continue;this._statusBarFilters.appendChild(this._createTimelineCategoryStatusBarCheckbox(category,this._onCategoryCheckboxClicked.bind(this,category)));}
|
| +var statsContainer=this._statusBarFilters.createChild("div");statsContainer.className="timeline-records-stats-container";this.recordsCounter=statsContainer.createChild("div");this.recordsCounter.className="timeline-records-stats";this.frameStatistics=statsContainer.createChild("div");this.frameStatistics.className="timeline-records-stats hidden";function getAnchor()
|
| {return this.frameStatistics;}
|
| -this._frameStatisticsPopoverHelper=new WebInspector.PopoverHelper(this.frameStatistics,getAnchor.bind(this),this._showFrameStatistics.bind(this));},_createTimelineCategoryStatusBarCheckbox:function(category)
|
| -{var labelContainer=document.createElement("div");labelContainer.addStyleClass("timeline-category-statusbar-item");labelContainer.addStyleClass("timeline-category-"+category.name);labelContainer.addStyleClass("status-bar-item");var label=labelContainer.createChild("label");var checkBorder=label.createChild("div","timeline-category-checkbox");var checkElement=checkBorder.createChild("div","timeline-category-checkbox-check timeline-category-checkbox-checked");checkElement.type="checkbox";checkElement.checked=true;labelContainer.addEventListener("click",listener.bind(this),false);function listener(event)
|
| -{var checked=!checkElement.checked;checkElement.checked=checked;category.hidden=!checked;checkElement.enableStyleClass("timeline-category-checkbox-checked",checkElement.checked);this._invalidateAndScheduleRefresh(true,true);}
|
| -var typeElement=label.createChild("span","type");typeElement.textContent=category.title;return labelContainer;},_setOperationInProgress:function(indicator)
|
| +this._frameStatisticsPopoverHelper=new WebInspector.PopoverHelper(this.frameStatistics,getAnchor.bind(this),this._showFrameStatistics.bind(this));},_createTimelineCategoryStatusBarCheckbox:function(category,onCheckboxClicked)
|
| +{var labelContainer=document.createElement("div");labelContainer.addStyleClass("timeline-category-statusbar-item");labelContainer.addStyleClass("timeline-category-"+category.name);labelContainer.addStyleClass("status-bar-item");var label=document.createElement("label");var checkBorder=label.createChild("div","timeline-category-checkbox");var checkElement=checkBorder.createChild("div","timeline-category-checkbox-check timeline-category-checkbox-checked");checkElement.type="checkbox";checkElement.checked=true;checkElement.addEventListener("click",listener,false);function listener(event)
|
| +{checkElement.checked=!checkElement.checked;checkElement.enableStyleClass("timeline-category-checkbox-checked",checkElement.checked);onCheckboxClicked(event);}
|
| +var typeElement=document.createElement("span");typeElement.className="type";typeElement.textContent=category.title;label.appendChild(typeElement);labelContainer.appendChild(label);return labelContainer;},_onCategoryCheckboxClicked:function(category,event)
|
| +{category.hidden=!event.target.checked;this._invalidateAndScheduleRefresh(true,true);},_setOperationInProgress:function(indicator)
|
| {this._operationInProgress=!!indicator;for(var i=0;i<this._statusBarItems.length;++i)
|
| this._statusBarItems[i].setEnabled(!this._operationInProgress);this._glueParentButton.setEnabled(!this._operationInProgress&&!this._frameController);this._miscStatusBarItems.removeChildren();this._miscStatusBarItems.appendChild(indicator?indicator.element:this._statusBarFilters);},_registerShortcuts:function()
|
| {this.registerShortcuts(WebInspector.TimelinePanelDescriptor.ShortcutKeys.StartStopRecording,this._toggleTimelineButtonClicked.bind(this));this.registerShortcuts(WebInspector.TimelinePanelDescriptor.ShortcutKeys.SaveToFile,this._saveToFile.bind(this));this.registerShortcuts(WebInspector.TimelinePanelDescriptor.ShortcutKeys.LoadFromFile,this._selectFileToLoad.bind(this));},_createFileSelector:function()
|
| @@ -752,9 +753,7 @@
|
| selectedIndex=0;this._selectSearchResult(selectedIndex);}else{WebInspector.searchController.updateSearchMatchesCount(0,this);delete this._selectedSearchResult;}},searchCanceled:function()
|
| {this._clearHighlight();delete this._searchResults;delete this._selectedSearchResult;delete this._searchRegExp;},canFilter:function()
|
| {return true;},performFilter:function(searchQuery)
|
| -{this._presentationModel.setSearchFilter(null);delete this._searchFilter;function cleanRecord(record)
|
| -{delete record.clicked;}
|
| -WebInspector.TimelinePresentationModel.forAllRecords(this._presentationModel.rootRecord().children,cleanRecord);this.searchCanceled();if(searchQuery){this._searchFilter=new WebInspector.TimelineSearchFilter(createPlainTextSearchRegex(searchQuery,"i"));this._presentationModel.setSearchFilter(this._searchFilter);}
|
| +{this._presentationModel.removeFilter(this._searchFilter);delete this._searchFilter;this.searchCanceled();if(searchQuery){this._searchFilter=new WebInspector.TimelineSearchFilter(createPlainTextSearchRegex(searchQuery,"i"));this._presentationModel.addFilter(this._searchFilter);}
|
| this._invalidateAndScheduleRefresh(true,true);},performSearch:function(query,shouldJump)
|
| {this._searchRegExp=createPlainTextSearchRegex(query,"i");delete this._searchResults;this._updateSearchHighlight(true,shouldJump);},__proto__:WebInspector.Panel.prototype}
|
| WebInspector.TimelineCalculator=function(model)
|
| @@ -795,12 +794,12 @@
|
| {this._record=record;this.element.className="timeline-graph-side timeline-category-"+record.category.name;if(isEven)
|
| this.element.addStyleClass("even");if(record.isBackground)
|
| this.element.addStyleClass("background");var barPosition=calculator.computeBarGraphWindowPosition(record);this._barWithChildrenElement.style.left=barPosition.left+"px";this._barWithChildrenElement.style.width=barPosition.widthWithChildren+"px";this._barElement.style.left=barPosition.left+"px";this._barElement.style.width=barPosition.width+"px";this._barCpuElement.style.left=barPosition.left+"px";this._barCpuElement.style.width=barPosition.cpuWidth+"px";this._expandElement._update(record,index,barPosition.left-expandOffset,barPosition.width);},_onClick:function(event)
|
| -{this._record.collapsed=!this._record.collapsed;this._record.clicked=true;this._scheduleRefresh(false,true);},dispose:function()
|
| +{this._record.collapsed=!this._record.collapsed;this._scheduleRefresh(false,true);},dispose:function()
|
| {this.element.remove();this._expandElement._dispose();}}
|
| WebInspector.TimelineExpandableElement=function(container)
|
| {this._element=container.createChild("div","timeline-expandable");this._element.createChild("div","timeline-expandable-left");this._element.createChild("div","timeline-expandable-arrow");}
|
| WebInspector.TimelineExpandableElement.prototype={_update:function(record,index,left,width)
|
| -{const rowHeight=WebInspector.TimelinePanel.rowHeight;if(record.visibleChildrenCount||record.expandable){this._element.style.top=index*rowHeight+"px";this._element.style.left=left+"px";this._element.style.width=Math.max(12,width+25)+"px";if(!record.collapsed){this._element.style.height=(record.visibleChildrenCount+1)*rowHeight+"px";this._element.addStyleClass("timeline-expandable-expanded");this._element.removeStyleClass("timeline-expandable-collapsed");}else{this._element.style.height=rowHeight+"px";this._element.addStyleClass("timeline-expandable-collapsed");this._element.removeStyleClass("timeline-expandable-expanded");}
|
| +{const rowHeight=WebInspector.TimelinePanel.rowHeight;if(record.visibleChildrenCount||record.invisibleChildrenCount){this._element.style.top=index*rowHeight+"px";this._element.style.left=left+"px";this._element.style.width=Math.max(12,width+25)+"px";if(!record.collapsed){this._element.style.height=(record.visibleChildrenCount+1)*rowHeight+"px";this._element.addStyleClass("timeline-expandable-expanded");this._element.removeStyleClass("timeline-expandable-collapsed");}else{this._element.style.height=rowHeight+"px";this._element.addStyleClass("timeline-expandable-collapsed");this._element.removeStyleClass("timeline-expandable-expanded");}
|
| this._element.removeStyleClass("hidden");}else
|
| this._element.addStyleClass("hidden");},_dispose:function()
|
| {this._element.remove();}}
|
|
|