Bug 216435 - Clean up LazyLoadImageObserver
Summary: Clean up LazyLoadImageObserver
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-12 07:38 PDT by Rob Buis
Modified: 2020-09-13 02:46 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.98 KB, patch)
2020-09-12 07:40 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (8.01 KB, patch)
2020-09-13 01:37 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2020-09-12 07:38:18 PDT
Clean up LazyLoadImageObserver to match LazyLoadFrameObserver, inspired by the review of
bug 215442. Specifically remove the friend declaration and create function, rename
m_lazyLoadImageObserver to make its use more clear and therefore remove the comment about it.
Comment 1 Rob Buis 2020-09-12 07:40:35 PDT
Created attachment 408594 [details]
Patch
Comment 2 Darin Adler 2020-09-12 14:27:03 PDT
Comment on attachment 408594 [details]
Patch

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

> Source/WebCore/html/LazyLoadImageObserver.h:46
> +    RefPtr<IntersectionObserver> m_lazyLoadImageIntersectionObserver;

You made this name longer, but I might have gone the opposite direction. Given that this is the intersection observer in the class LazyLoadImageObserver, obviously it’s the one for lazily loading image, so I would leave the words "lazy", "load", and "image" out of the name. I might even just call it m_observer, given the narrow context of being the only data member of this particular class. A longer name isn’t really helpful to understand what this is for.
Comment 3 Rob Buis 2020-09-13 01:37:17 PDT
Created attachment 408645 [details]
Patch
Comment 4 Rob Buis 2020-09-13 02:41:10 PDT
Comment on attachment 408594 [details]
Patch

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

>> Source/WebCore/html/LazyLoadImageObserver.h:46
>> +    RefPtr<IntersectionObserver> m_lazyLoadImageIntersectionObserver;
> 
> You made this name longer, but I might have gone the opposite direction. Given that this is the intersection observer in the class LazyLoadImageObserver, obviously it’s the one for lazily loading image, so I would leave the words "lazy", "load", and "image" out of the name. I might even just call it m_observer, given the narrow context of being the only data member of this particular class. A longer name isn’t really helpful to understand what this is for.

Interesting. I think you are right, given the class name the member var name was too long and contained duplicate information. Fixed now, also for LazyLoadFrameObserver to be consistent.
Comment 5 EWS 2020-09-13 02:45:12 PDT
Committed r266991: <https://trac.webkit.org/changeset/266991>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 408645 [details].
Comment 6 Radar WebKit Bug Importer 2020-09-13 02:46:17 PDT
<rdar://problem/68795266>