WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
210944
Reduce use of WebPageProxy::VoidCallback
https://bugs.webkit.org/show_bug.cgi?id=210944
Summary
Reduce use of WebPageProxy::VoidCallback
Alex Christensen
Reported
2020-04-23 16:40:58 PDT
Reduce use of WebPageProxy::VoidCallback
Attachments
Patch
(39.58 KB, patch)
2020-04-23 16:51 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(39.55 KB, patch)
2020-04-24 13:56 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2020-04-23 16:51:16 PDT
Created
attachment 397401
[details]
Patch
Darin Adler
Comment 2
2020-04-24 11:17:19 PDT
Comment on
attachment 397401
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=397401&action=review
> Source/WebKit/UIProcess/WebPageProxy.cpp:2176 > + sendWithAsyncReply(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::setInitialFocus"_s)] () mutable {
Why does this need to be "mutable"? Same question about the various other similar cases below.
> Source/WebKit/UIProcess/WebPageProxy.h:782 > + void focusNextFocusedElement(bool isForward, CompletionHandler<void()>&& = []() { });
I believe our coding style is to omit the () here. There are 10 or more other cases of this in this patch. I suggest removing them all.
Alex Christensen
Comment 3
2020-04-24 13:49:06 PDT
Calling a CompletionHandler deletes its callable immediately after calling, which requires it to be non-const. Will remove unnecessary ().
Alex Christensen
Comment 4
2020-04-24 13:56:19 PDT
Created
attachment 397503
[details]
Patch
Darin Adler
Comment 5
2020-04-25 11:23:14 PDT
Comment on
attachment 397503
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=397503&action=review
> Source/WebKit/UIProcess/WebPageProxy.cpp:2314 > + sendWithAsyncReply(Messages::WebPage::ExecuteEditCommandWithCallback(commandName, argument), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::executeEditCommand"_s)] () mutable {
One last case of () that you didn't delete yet.
Alex Christensen
Comment 6
2020-04-27 10:08:38 PDT
Comment on
attachment 397503
[details]
Patch That is unfortunately necessary because of the mutable in C++ until
http://wg21.link/P1102
is accepted.
EWS
Comment 7
2020-04-27 10:13:22 PDT
Committed
r260764
: <
https://trac.webkit.org/changeset/260764
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 397503
[details]
.
Radar WebKit Bug Importer
Comment 8
2020-04-27 10:14:14 PDT
<
rdar://problem/62457381
>
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