WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
240981
Move disk operations when deleting cookies off from the main thread
https://bugs.webkit.org/show_bug.cgi?id=240981
Summary
Move disk operations when deleting cookies off from the main thread
Alex Christensen
Reported
2022-05-26 14:56:46 PDT
When it's on the main thread, it causes hangs and lack of responsiveness.
Attachments
Patch
(43.79 KB, patch)
2022-05-26 15:07 PDT
,
Alex Christensen
achristensen
: review-
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2022-05-26 15:00:14 PDT
https://github.com/WebKit/WebKit/pull/1072
Alex Christensen
Comment 2
2022-05-26 15:07:03 PDT
Created
attachment 459795
[details]
Patch
Chris Dumez
Comment 3
2022-05-26 15:13:29 PDT
Comment on
attachment 459795
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=459795&action=review
> Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:155 > + [nsCookieStorage() setCookie:newCookie];
Isn't this doing a cookie storage operation on the main thread?
> Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:585 > + [nsCookieStorage() _saveCookies:makeBlockPtr([completionHandler = WTFMove(completionHandler)] () mutable {
Isn't this doing cookie operations on the main thread?
> Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h:76 > + void deleteAllCookies(PAL::SessionID, CompletionHandler<void()>&&);
I wish you'd use `CompletionHandler<void()>&&` consistently in your patch. However, you're using `CompletionHandler<void()>` as parameter sometimes.
Alex Christensen
Comment 4
2022-05-26 15:19:25 PDT
(In reply to Chris Dumez from
comment #3
)
> Comment on
attachment 459795
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=459795&action=review
> > > Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:155 > > + [nsCookieStorage() setCookie:newCookie]; > > Isn't this doing a cookie storage operation on the main thread?
I think setting a cookie doesn't always immediately go to disk on the same thread. This patch only addresses cookie deleting on the main thread.
> > Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:585 > > + [nsCookieStorage() _saveCookies:makeBlockPtr([completionHandler = WTFMove(completionHandler)] () mutable { > > Isn't this doing cookie operations on the main thread?
Ditto.
> > Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h:76 > > + void deleteAllCookies(PAL::SessionID, CompletionHandler<void()>&&); > > I wish you'd use `CompletionHandler<void()>&&` consistently in your patch. > However, you're using `CompletionHandler<void()>` as parameter sometimes.
I'm trying to move to without && but there were places where it looked out of place. The two are functionally equivalent.
Chris Dumez
Comment 5
2022-05-26 15:22:25 PDT
(In reply to Alex Christensen from
comment #4
)
> (In reply to Chris Dumez from
comment #3
) > > Comment on
attachment 459795
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=459795&action=review
> > > > > Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:155 > > > + [nsCookieStorage() setCookie:newCookie]; > > > > Isn't this doing a cookie storage operation on the main thread? > I think setting a cookie doesn't always immediately go to disk on the same > thread. This patch only addresses cookie deleting on the main thread. > > > > Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:585 > > > + [nsCookieStorage() _saveCookies:makeBlockPtr([completionHandler = WTFMove(completionHandler)] () mutable { > > > > Isn't this doing cookie operations on the main thread? > Ditto. > > > > Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h:76 > > > + void deleteAllCookies(PAL::SessionID, CompletionHandler<void()>&&); > > > > I wish you'd use `CompletionHandler<void()>&&` consistently in your patch. > > However, you're using `CompletionHandler<void()>` as parameter sometimes. > I'm trying to move to without && but there were places where it looked out > of place. The two are functionally equivalent.
CompletionHandler<void()>&& communicates to the caller that we want a r-value and they need to WTFMove(). CompletionHandler<void()> doesn't communicate that. It will give a build time error though if they fail to WTFMove() (only because CompletionHandler is not copyable).
Alex Christensen
Comment 6
2022-05-26 15:41:47 PDT
Comment on
attachment 459795
[details]
Patch GitHub PR has more &&
EWS
Comment 7
2022-05-27 12:21:15 PDT
Committed
r294947
(
251055@main
): <
https://commits.webkit.org/251055@main
> Reviewed commits have been landed. Closing PR #1072 and removing active labels.
Radar WebKit Bug Importer
Comment 8
2022-05-27 12:22:14 PDT
<
rdar://problem/94048443
>
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