WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
209706
Add a ScrollLatching log channel and improve some logging functionality
https://bugs.webkit.org/show_bug.cgi?id=209706
Summary
Add a ScrollLatching log channel and improve some logging functionality
Simon Fraser (smfr)
Reported
2020-03-28 12:31:33 PDT
Add a ScrollLatching log channel and improve some logging functionality
Attachments
Patch
(21.95 KB, patch)
2020-03-28 12:33 PDT
,
Simon Fraser (smfr)
no flags
Details
Formatted Diff
Diff
Patch
(22.05 KB, patch)
2020-03-28 13:27 PDT
,
Simon Fraser (smfr)
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2020-03-28 12:33:56 PDT
Created
attachment 394837
[details]
Patch
Simon Fraser (smfr)
Comment 2
2020-03-28 13:27:17 PDT
Created
attachment 394840
[details]
Patch
Darin Adler
Comment 3
2020-03-28 17:15:34 PDT
Comment on
attachment 394840
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=394840&action=review
> Source/WTF/wtf/text/TextStream.h:31 > +#include <wtf/WeakPtr.h>
Would be nice to find a way to make the weak pointers easy to stream, but not have TextStream.h need to include WeakPtr.h.
> Source/WebCore/page/mac/EventHandlerMac.mm:1058 > + const ScrollLatchingState* latchingState = m_frame.page() ? m_frame.page()->latchingState() : nullptr;
How about auto or auto* instead?
> Source/WebCore/page/mac/EventHandlerMac.mm:1102 > + const ScrollLatchingState* latchingState = m_frame.page() ? m_frame.page()->latchingState() : nullptr;
Ditto.
> Source/WebCore/page/scrolling/ScrollLatchingState.h:40 > -class ScrollLatchingState final { > +class ScrollLatchingState {
Why this change?
David Kilzer (:ddkilzer)
Comment 4
2020-03-28 17:17:30 PDT
Comment on
attachment 394840
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=394840&action=review
r=me, but please change `int` to `size_t`.
> Source/WebCore/dom/Node.cpp:2619 > + const int FormatBufferSize = 512;
const size_t please.
Simon Fraser (smfr)
Comment 5
2020-03-28 17:55:36 PDT
(In reply to Darin Adler from
comment #3
)
> Comment on
attachment 394840
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=394840&action=review
> > > Source/WTF/wtf/text/TextStream.h:31 > > +#include <wtf/WeakPtr.h> > > Would be nice to find a way to make the weak pointers easy to stream, but > not have TextStream.h need to include WeakPtr.h.
Could move this to WeakPtr, but would have to add a .cpp to avoid pulling TextStream.h into the header.
> > Source/WebCore/page/mac/EventHandlerMac.mm:1058 > > + const ScrollLatchingState* latchingState = m_frame.page() ? m_frame.page()->latchingState() : nullptr; > > How about auto or auto* instead?
Sure.
> > Source/WebCore/page/scrolling/ScrollLatchingState.h:40 > > -class ScrollLatchingState final { > > +class ScrollLatchingState { > > Why this change?
ScrollLatchingState doesn't have any virtual member functions, so there doesn't seem to be any expectation that anyone will inherit from it. Is there value in keeping 'final' here?
Simon Fraser (smfr)
Comment 6
2020-03-28 18:58:48 PDT
https://trac.webkit.org/changeset/259165/webkit
Radar WebKit Bug Importer
Comment 7
2020-03-28 18:59:15 PDT
<
rdar://problem/61018328
>
Darin Adler
Comment 8
2020-03-28 19:29:08 PDT
Comment on
attachment 394840
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=394840&action=review
>>> Source/WebCore/page/scrolling/ScrollLatchingState.h:40 >>> +class ScrollLatchingState { >> >> Why this change? > > ScrollLatchingState doesn't have any virtual member functions, so there doesn't seem to be any expectation that anyone will inherit from it. Is there value in keeping 'final' here?
There are various classes that are entirely non-polymorphic with nothing virtual. I would never *add* final to one of those, but I also was thinking I wouldn’t remove it either. It’s kind of like the "const" some people want to put on the many, many local variables. There is possibly some minimal value in clarifying that there are no classes derived from this one. Anyway, OK to remove it, but I was wondering what your thinking on this way.
alan baradlay
Comment 9
2020-03-28 21:02:05 PDT
> I wouldn’t remove it either. It’s kind of like the "const" some people want > to put on the many, many local variables.
It's really not the right place to discuss it, but I've been meaning to ask your take on this.
Darin Adler
Comment 10
2020-03-29 01:10:15 PDT
(In reply to zalan from
comment #9
)
> > I wouldn’t remove it either. It’s kind of like the "const" some people want > > to put on the many, many local variables. > It's really not the right place to discuss it, but I've been meaning to ask > your take on this.
I wish this was a language where const was the default and variables you want to modify are the ones with an extra keyword or one like Swift which has both let and var that are equally economical to write and in which you even get a warning if you use a var and never modify it. But given that this is C++ I think it’s not so great to add constexpr or const to every local variable that we happen not to be modifying after it’s created. I’d rather see lots of auto rather than lots of const auto; the extra keyword just doesn’t seem,worth it. That’s my current take. If we were putting const on all those locals I guess we could do the same with function arguments in function definitions with the same minimal benefit.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug