Bug 82735 - Web Inspector: [refactoring] factor our frame aggregation logic to TimelineFrameController
Summary: Web Inspector: [refactoring] factor our frame aggregation logic to TimelineFr...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Kosyakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-30 09:13 PDT by Andrey Kosyakov
Modified: 2012-04-02 05:49 PDT (History)
10 users (show)

See Also:


Attachments
Patch (20.28 KB, patch)
2012-03-30 09:16 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
Patch (24.90 KB, patch)
2012-03-30 09:30 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
Patch (26.09 KB, patch)
2012-04-02 02:01 PDT, Andrey Kosyakov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Kosyakov 2012-03-30 09:13:07 PDT
We'd like to reuse frame information in both overview pane and lower pane, so this should be moved out to a separate class.
Comment 1 Andrey Kosyakov 2012-03-30 09:16:30 PDT
Created attachment 134824 [details]
Patch
Comment 2 Early Warning System Bot 2012-03-30 09:25:01 PDT
Comment on attachment 134824 [details]
Patch

Attachment 134824 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/12288282
Comment 3 Early Warning System Bot 2012-03-30 09:25:47 PDT
Comment on attachment 134824 [details]
Patch

Attachment 134824 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/12266359
Comment 4 Pavel Feldman 2012-03-30 09:29:13 PDT
Comment on attachment 134824 [details]
Patch

Please add the new file to the change.
Comment 5 Andrey Kosyakov 2012-03-30 09:30:13 PDT
Created attachment 134828 [details]
Patch
Comment 6 Pavel Feldman 2012-03-30 09:44:22 PDT
Comment on attachment 134828 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134828&action=review

It sounds like this change is not only factoring out what is claimed, but makes random changes to the code. Could you please split it?

> Source/WebCore/ChangeLog:8
> +        * WebCore.gypi: Added TimelineFrameController.js

Where is the new file?

> Source/WebCore/inspector/front-end/TimelineFrameController.js:52
> +        this._addRecord(event.data);

Do we need to add this when panel is not shown?

> Source/WebCore/inspector/front-end/TimelineFrameController.js:87
> +        console.error("shynthetic frame");

Please remove the debug logging.

> Source/WebCore/inspector/front-end/TimelineModel.js:105
> +    var categories = Object.keys(increment);

Please annotate this, btw we do for in all over the place.

> Source/WebCore/inspector/front-end/TimelineModel.js:116
> +    var childrenTime = 0;

Please annotate this.

> Source/WebCore/inspector/front-end/TimelineOverviewPane.js:-931
> -        var totalTime = 0;

Where did this method go?

> Source/WebCore/inspector/front-end/TimelineOverviewPane.js:885
> +                if (!longestFrame || longestFrame.cpuTime < this._frames[currentFrame].cpuTime)

What is longestFrame?
Comment 7 Andrey Kosyakov 2012-04-02 02:01:17 PDT
Created attachment 135044 [details]
Patch
Comment 8 Andrey Kosyakov 2012-04-02 02:07:52 PDT
(In reply to comment #6)
> 
> It sounds like this change is not only factoring out what is claimed, but makes random changes to the code. Could you please split it?

Well, those are not entirely random. I wouldn't like to spit it, as these are closely interconnected. I tried to do a better job of explaining what happens in the ChangeLog.

> > Source/WebCore/ChangeLog:8
> > +        * WebCore.gypi: Added TimelineFrameController.js
> Where is the new file?

Fixing.

> > Source/WebCore/inspector/front-end/TimelineFrameController.js:52
> > +        this._addRecord(event.data);
> Do we need to add this when panel is not shown?

I addressed this as a separate change (bug 82861)

> > Source/WebCore/inspector/front-end/TimelineFrameController.js:87
> > +        console.error("shynthetic frame");
> Please remove the debug logging.

Oops. Thanks for spotting!

> > Source/WebCore/inspector/front-end/TimelineModel.js:105
> > +    var categories = Object.keys(increment);
> Please annotate this, btw we do for in all over the place.

done.

> > Source/WebCore/inspector/front-end/TimelineModel.js:116
> > +    var childrenTime = 0;
> 
> Please annotate this.
Done.

> > Source/WebCore/inspector/front-end/TimelineOverviewPane.js:-931
> > -        var totalTime = 0;
> 
> Where did this method go?

We used to do aggregation separately by frames or by top-level events in case we don't have frames. Now we just always simulate frames in TimelineFrameController, and the aggregation happens there as well -- except for the case when we need to show one bar per multiple frames.

> > Source/WebCore/inspector/front-end/TimelineOverviewPane.js:885
> > +                if (!longestFrame || longestFrame.cpuTime < this._frames[currentFrame].cpuTime)
> 
> What is longestFrame?

The frame that took most CPU time.
Comment 9 Andrey Kosyakov 2012-04-02 05:49:58 PDT
Committed r112865: <http://trac.webkit.org/changeset/112865>