Bug 143198 - Convert arguments to ScrollingCoordinator functions to references
Summary: Convert arguments to ScrollingCoordinator functions to references
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-29 13:11 PDT by Simon Fraser (smfr)
Modified: 2015-03-29 21:16 PDT (History)
14 users (show)

See Also:


Attachments
Patch (67.28 KB, patch)
2015-03-29 13:14 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (68.63 KB, patch)
2015-03-29 13:29 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (72.10 KB, patch)
2015-03-29 13:35 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (72.07 KB, patch)
2015-03-29 13:41 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (73.54 KB, patch)
2015-03-29 14:08 PDT, Simon Fraser (smfr)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-03-29 13:11:38 PDT
Convert arguments to ScrollingCoordinator functions to references
Comment 1 Simon Fraser (smfr) 2015-03-29 13:14:25 PDT
Created attachment 249694 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-03-29 13:29:58 PDT
Created attachment 249695 [details]
Patch
Comment 3 Simon Fraser (smfr) 2015-03-29 13:35:08 PDT
Created attachment 249696 [details]
Patch
Comment 4 Simon Fraser (smfr) 2015-03-29 13:41:40 PDT
Created attachment 249697 [details]
Patch
Comment 5 Simon Fraser (smfr) 2015-03-29 14:08:02 PDT
Created attachment 249699 [details]
Patch
Comment 6 Darin Adler 2015-03-29 16:32:01 PDT
Comment on attachment 249699 [details]
Patch

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

Not sure that there is a useful distinction between const FrameView& and FrameView&. While I understand that some functions might not change anything, generally FrameView is a pointer into a massive object graph, not a single object that can be mutated or left alone directly. If I get a FrameView’s document and the operate on it and it turns around and operates on the FrameView is that a const FrameView& thing or not?

> Source/WebCore/page/scrolling/ScrollingCoordinator.h:193
> -        ForcedOnMainThread = 1 << 0,
> -        HasSlowRepaintObjects = 1 << 1,
> -        HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 2,
> -        HasNonLayerViewportConstrainedObjects = 1 << 3,
> -        IsImageDocument = 1 << 4
> +        ForcedOnMainThread                                          = 1 << 0,
> +        HasSlowRepaintObjects                                       = 1 << 1,
> +        HasViewportConstrainedObjectsWithoutSupportingFixedLayers   = 1 << 2,
> +        HasNonLayerViewportConstrainedObjects                       = 1 << 3,
> +        IsImageDocument                                             = 1 << 4

We should discuss whether to do this or not, and put it in the coding style guidelines one way or another. If I had seen code like the “after” here, I would have changed it to look like the “before”. My rationale is that I don’t like having to re-line things up when renaming.
Comment 7 Simon Fraser (smfr) 2015-03-29 21:16:02 PDT
https://trac.webkit.org/r182132

(In reply to comment #6)
> Comment on attachment 249699 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=249699&action=review
> 
> Not sure that there is a useful distinction between const FrameView& and
> FrameView&. While I understand that some functions might not change
> anything, generally FrameView is a pointer into a massive object graph, not
> a single object that can be mutated or left alone directly. If I get a
> FrameView’s document and the operate on it and it turns around and operates
> on the FrameView is that a const FrameView& thing or not?

True. I added the const so that a later change which operates on a const ScrollableArea will work.

> > Source/WebCore/page/scrolling/ScrollingCoordinator.h:193
> > -        ForcedOnMainThread = 1 << 0,
> > -        HasSlowRepaintObjects = 1 << 1,
> > -        HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 2,
> > -        HasNonLayerViewportConstrainedObjects = 1 << 3,
> > -        IsImageDocument = 1 << 4
> > +        ForcedOnMainThread                                          = 1 << 0,
> > +        HasSlowRepaintObjects                                       = 1 << 1,
> > +        HasViewportConstrainedObjectsWithoutSupportingFixedLayers   = 1 << 2,
> > +        HasNonLayerViewportConstrainedObjects                       = 1 << 3,
> > +        IsImageDocument                                             = 1 << 4
> 
> We should discuss whether to do this or not, and put it in the coding style
> guidelines one way or another. If I had seen code like the “after” here, I
> would have changed it to look like the “before”. My rationale is that I
> don’t like having to re-line things up when renaming.

I'll start a thread about this on webkit-dev.