WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
234322
Add ModalContainerControlClassifier and use it to implement classifyModalContainerControls()
https://bugs.webkit.org/show_bug.cgi?id=234322
Summary
Add ModalContainerControlClassifier and use it to implement classifyModalCont...
Wenson Hsieh
Reported
2021-12-14 15:46:42 PST
.
Attachments
Patch
(23.23 KB, patch)
2021-12-17 12:42 PST
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Rebase on trunk
(19.26 KB, patch)
2021-12-20 14:38 PST
,
Wenson Hsieh
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Fix macOS 10.14 build
(18.71 KB, patch)
2021-12-20 15:00 PST
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Style error is false positive
(18.49 KB, patch)
2021-12-20 16:34 PST
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Ignore style error
(18.49 KB, patch)
2021-12-20 16:52 PST
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2021-12-17 12:42:01 PST
Comment hidden (obsolete)
Created
attachment 447469
[details]
Patch
Wenson Hsieh
Comment 2
2021-12-20 14:38:16 PST
Comment hidden (obsolete)
Created
attachment 447640
[details]
Rebase on trunk
Wenson Hsieh
Comment 3
2021-12-20 15:00:08 PST
Created
attachment 447648
[details]
Fix macOS 10.14 build
Devin Rousso
Comment 4
2021-12-20 15:40:10 PST
Comment on
attachment 447648
[details]
Fix macOS 10.14 build View in context:
https://bugs.webkit.org/attachment.cgi?id=447648&action=review
r=me, neato :)
> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.h:28 > +#import <wtf/CompletionHandler.h>
NIT: Could/Should we use `<wtf/Forward.h>` for these instead?
> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.h:46 > + ModalContainerControlClassifier();
Should this be in `private:`?
> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.h:48 > + void classify(Vector<String>&&, CompletionHandler<void(Vector<WebCore::ModalContainerControlType>&&)>&&);
Style: I'd make this `Vector<String>&& texts` as it's not really clear what that parameter is supposed to be used for just by looking at the type.
> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.mm:125 > +static std::unique_ptr<ModalContainerControlClassifier>& sharedModalContainerControlClassifier()
NIT: I'd inline this
> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.mm:156 > + for (NSInteger index = 0; index < [batch count]; ++index) {
Why not `[resultProvider count]`?
> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.mm:175 > + m_queue->dispatch([this, texts = texts.isolatedCopy(), completion = WTFMove(completion)]() mutable {
Are you doing `texts.isolatedCopy()` instead of `WTFMove(texts)` to avoid deallocing on a different thread? Is that an issue for `Vector`/`String`?
Wenson Hsieh
Comment 5
2021-12-20 16:11:39 PST
Comment on
attachment 447648
[details]
Fix macOS 10.14 build View in context:
https://bugs.webkit.org/attachment.cgi?id=447648&action=review
Thanks for the review!
>> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.h:28 >> +#import <wtf/CompletionHandler.h> > > NIT: Could/Should we use `<wtf/Forward.h>` for these instead?
Sure.
>> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.h:46 >> + ModalContainerControlClassifier(); > > Should this be in `private:`?
Hm…I might be able to, if I `friend std::unique_ptr<~>`… Will give that a try.
>> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.h:48 >> + void classify(Vector<String>&&, CompletionHandler<void(Vector<WebCore::ModalContainerControlType>&&)>&&); > > Style: I'd make this `Vector<String>&& texts` as it's not really clear what that parameter is supposed to be used for just by looking at the type.
👍🏻
>> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.mm:125 >> +static std::unique_ptr<ModalContainerControlClassifier>& sharedModalContainerControlClassifier() > > NIT: I'd inline this
Good point. Moved into the implementation of `sharedClassifier()` below.
>> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.mm:156 >> + for (NSInteger index = 0; index < [batch count]; ++index) { > > Why not `[resultProvider count]`?
Good point — changed to use `resultProvider.count` here.
>> Source/WebKit/UIProcess/Cocoa/ModalContainerControlClassifier.mm:175 >> + m_queue->dispatch([this, texts = texts.isolatedCopy(), completion = WTFMove(completion)]() mutable { > > Are you doing `texts.isolatedCopy()` instead of `WTFMove(texts)` to avoid deallocing on a different thread? Is that an issue for `Vector`/`String`?
I believe it is. These strings passed into `classify()` were created on the main thread, so they should also be destroyed on the main thread…AFAICT.
Wenson Hsieh
Comment 6
2021-12-20 16:34:13 PST
Comment hidden (obsolete)
Created
attachment 447663
[details]
Style error is false positive
Wenson Hsieh
Comment 7
2021-12-20 16:52:50 PST
Created
attachment 447665
[details]
Ignore style error
EWS
Comment 8
2021-12-20 19:11:00 PST
Committed
r287296
(
245448@main
): <
https://commits.webkit.org/245448@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 447665
[details]
.
Radar WebKit Bug Importer
Comment 9
2021-12-20 19:12:17 PST
<
rdar://problem/86750278
>
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