Web Inspector: [refactoring] factor our frame aggregation logic to TimelineFrameContr...
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 12:49:29 +0000 (12:49 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 12:49:29 +0000 (12:49 +0000)
commit07fdef3e09cdfab559e0d85798a011d20fdb96a8
treedf99b8c544e7a312647be034d4928fd063c4ea7c
parent1c55c7c9aaddee241c1a7cf2f962ee347aa2b851
Web Inspector: [refactoring] factor our frame aggregation logic to TimelineFrameController
https://bugs.webkit.org/show_bug.cgi?id=82735

Reviewed by Pavel Feldman.

- factor out frame aggregation logic from TimelineVerticalOverview into TimelineFrameController;
- if we don't have frames, pretend each top-level event is a frame (this preserves behavior of vertical overview);
- factor out time-by-category stats aggregation into class methods of TimelineModel for reuse accross timeline modules;
- do not filter top-level events by type in vertical overview mode;

* WebCore.gypi: Added TimelineFrameController.js
* WebCore.vcproj/WebCore.vcproj: ditto.
* inspector/compile-front-end.py: ditto.
* inspector/front-end/TimelineFrameController.js: Added.
(WebInspector.TimelineFrameController):
(WebInspector.TimelineFrameController.prototype._onRecordAdded):
(WebInspector.TimelineFrameController.prototype._onRecordsCleared):
(WebInspector.TimelineFrameController.prototype._addRecord):
(WebInspector.TimelineFrameController.prototype._flushFrame):
(WebInspector.TimelineFrameController.prototype._createSyntheticFrame): create a "frame" based on a single top-level record.
(WebInspector.TimelineFrameController.prototype.dispose): Remove listeners that we added in constructor.
(WebInspector.TimelineFrame):
* inspector/front-end/TimelineModel.js: Added utilities for aggregating times by categories.
(WebInspector.TimelineModel.aggregateTimeByCategories):
(WebInspector.TimelineModel.aggregateTimeForRecord):
* inspector/front-end/TimelineOverviewPane.js: Use frame information supplied by TimelineFrameController.
(WebInspector.TimelineOverviewPane.prototype._showTimelines):
(WebInspector.TimelineOverviewPane.prototype._setVerticalOverview):
(WebInspector.TimelineOverviewPane.prototype.addFrame):
(WebInspector.TimelineVerticalOverview.prototype.reset): Clear stored frames upon reset()
(WebInspector.TimelineVerticalOverview.prototype.update):
(WebInspector.TimelineVerticalOverview.prototype.addFrame):
(WebInspector.TimelineVerticalOverview.prototype._aggregateFrames):
(WebInspector.TimelineVerticalOverview.prototype.getWindowTimes):
* inspector/front-end/TimelinePanel.js: Create/dispose TimelineFrameController when switching to/from vertical overview mode.
* inspector/front-end/TimelinePresentationModel.js:
(WebInspector.TimelinePresentationModel.Record.prototype.calculateAggregatedStats): Factored out statistics aggregation to utilities method in the model.
* inspector/front-end/WebKit.qrc: Added TimelineFrameController.js
* inspector/front-end/inspector.html: ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/inspector/compile-front-end.py
Source/WebCore/inspector/front-end/TimelineFrameController.js [new file with mode: 0644]
Source/WebCore/inspector/front-end/TimelineModel.js
Source/WebCore/inspector/front-end/TimelineOverviewPane.js
Source/WebCore/inspector/front-end/TimelinePanel.js
Source/WebCore/inspector/front-end/WebKit.qrc
Source/WebCore/inspector/front-end/inspector.html