Bug 131184

Summary: Web Inspector: remove unused metrics and commands from the Timeline agent
Product: WebKit Reporter: Brian Burg <burg>
Component: Web InspectorAssignee: Brian Burg <burg>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, commit-queue, graouts, joepeck, kondapallykalyan, luiz, noam, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
the patch
none
the patch, now with less didComposite
none
the patch, with old protocols fixed none

Description Brian Burg 2014-04-03 15:03:33 PDT
This is a nontrivial amount of data (unsigned long per record) and we don't do anything with it. Any use of it would probably part of a more comprehensive feature.
Comment 1 Radar WebKit Bug Importer 2014-04-03 15:04:10 PDT
<rdar://problem/16517540>
Comment 2 Timothy Hatcher 2014-04-03 17:56:29 PDT
Sounds good.
Comment 3 Brian Burg 2014-04-04 23:34:15 PDT
This includes:

 - used heap size for every timeline record
 - begin/cancel frame messages, which were broken
 - runtime querying of feature support for features nobody implements
Comment 4 Brian Burg 2014-04-04 23:51:52 PDT
Created attachment 228662 [details]
the patch
Comment 5 Timothy Hatcher 2014-04-05 09:15:34 PDT
Comment on attachment 228662 [details]
the patch

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

> Source/WebCore/inspector/InspectorController.h:129
>      void willComposite();

This too isn't used.

> Source/WebCore/inspector/InspectorController.h:130
>      void didComposite();

Ditto.

> Source/WebCore/inspector/protocol/Timeline.json:-19
> -                { "name": "usedHeapSize", "type": "integer", "optional": true, "description": "Current size of JS heap." }

These should be removed from iOS 7 protocol files too.
Comment 6 Timothy Hatcher 2014-04-05 09:16:33 PDT
I do want to track rendered frames, but we can add it back at that time (likely with a better design.)
Comment 7 Brian Burg 2014-04-05 11:23:11 PDT
(In reply to comment #6)
> I do want to track rendered frames, but we can add it back at that time (likely with a better design.)

Right. I kept the enum value in there because it would be useful to have this functionality. Just none of the existing plumbing works.
Comment 8 Brian Burg 2014-04-05 11:25:45 PDT
(In reply to comment #5)
> (From update of attachment 228662 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=228662&action=review
> 
> > Source/WebCore/inspector/InspectorController.h:129
> >      void willComposite();
> 
> This too isn't used.
> 
> > Source/WebCore/inspector/InspectorController.h:130
> >      void didComposite();
> 
> Ditto.
> 
> > Source/WebCore/inspector/protocol/Timeline.json:-19
> > -                { "name": "usedHeapSize", "type": "integer", "optional": true, "description": "Current size of JS heap." }
> 
> These should be removed from iOS 7 protocol files too.

What about counters and other heap- and frame-related  stuff in the protocol file that has never been used in the current inspector UI?
Comment 9 Brian Burg 2014-04-05 12:33:07 PDT
Created attachment 228679 [details]
the patch, now with less didComposite
Comment 10 Timothy Hatcher 2014-04-05 13:47:14 PDT
(In reply to comment #8)
> (In reply to comment #5)
> > (From update of attachment 228662 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=228662&action=review
> > 
> > > Source/WebCore/inspector/InspectorController.h:129
> > >      void willComposite();
> > 
> > This too isn't used.
> > 
> > > Source/WebCore/inspector/InspectorController.h:130
> > >      void didComposite();
> > 
> > Ditto.
> > 
> > > Source/WebCore/inspector/protocol/Timeline.json:-19
> > > -                { "name": "usedHeapSize", "type": "integer", "optional": true, "description": "Current size of JS heap." }
> > 
> > These should be removed from iOS 7 protocol files too.
> 
> What about counters and other heap- and frame-related  stuff in the protocol file that has never been used in the current inspector UI?

Yes, anything we have removed from TOT should be removed from the old protocols versions too. That way if we want to use those names in the future, we can feature check the protocol and only get the new version.

We likely have missed some thing during removal. I pulled some things out the other day that I missed when cleaning up the profiler.
Comment 11 Timothy Hatcher 2014-04-05 13:48:05 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > I do want to track rendered frames, but we can add it back at that time (likely with a better design.)
> 
> Right. I kept the enum value in there because it would be useful to have this functionality. Just none of the existing plumbing works.

We probably should remove the enums too — for completeness. Easy to add back later when needed.
Comment 12 Timothy Hatcher 2014-04-05 13:49:52 PDT
Comment on attachment 228679 [details]
the patch, now with less didComposite

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

> Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorWebBackendCommands.js:-238
> -InspectorBackend.registerCommand("Timeline.supportsFrameInstrumentation", [], ["result"]);
> -InspectorBackend.registerCommand("Timeline.canMonitorMainThread", [], ["result"]);

This should be removed from the .json file in WebInspectorUI/Versions too.
Comment 13 Brian Burg 2014-04-05 17:07:14 PDT
Created attachment 228687 [details]
the patch, with old protocols fixed
Comment 14 Brian Burg 2014-04-05 17:51:41 PDT
Committed r166846: <http://trac.webkit.org/changeset/166846>