RESOLVED FIXED 216435
Clean up LazyLoadImageObserver
https://bugs.webkit.org/show_bug.cgi?id=216435
Summary Clean up LazyLoadImageObserver
Rob Buis
Reported 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.
Attachments
Patch (4.98 KB, patch)
2020-09-12 07:40 PDT, Rob Buis
no flags
Patch (8.01 KB, patch)
2020-09-13 01:37 PDT, Rob Buis
no flags
Rob Buis
Comment 1 2020-09-12 07:40:35 PDT
Darin Adler
Comment 2 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.
Rob Buis
Comment 3 2020-09-13 01:37:17 PDT
Rob Buis
Comment 4 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.
EWS
Comment 5 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].
Radar WebKit Bug Importer
Comment 6 2020-09-13 02:46:17 PDT
Note You need to log in before you can comment on or make changes to this bug.