New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebPermissionControllerProxy::Query message reply should go to correct completion handler #5984
Conversation
723d168
to
104a36d
Compare
EWS run on previous version of this PR (hash 104a36d) |
EWS run on previous version of this PR (hash 723d168) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch is fine for making requests non-blocking and the code simpler; but I am not sure it will fix the crash in the radar.
If we are going to make this change, maybe we should also remove m_requests (just send Query message in query()
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to test this?
|
||
m_requests.takeFirst().completionHandler(state); | ||
tryProcessingRequests(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will tryProcessingRequests() become dead code now? What did it do previously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In existing implementation, tryProcessingRequests
just sends one async message for the first request in queue. If the first request has already sent message and no reply, it will return. That means one unhandled request will block the other requests in queue.
When the reply is received, the first request will be taken out of queue and tryProcessingRequests` is called to proceed next message.
We had this design because WebPermissionController used to cache permission result, which means tryProcessingRequests
might handle multiple requests at a time (if the result is in the cache), and receiving one message reply (caching the result) may benefit the subsequent requests.
But we removed the cache and send message for each request now, so we can send them when request is received, and finish CompletionHandler in message reply (as in this patch). And there is not need to store the requests in m_requests
.
104a36d
to
c9f3c29
Compare
EWS run on current version of this PR (hash c9f3c29) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
β¦t completion handler https://bugs.webkit.org/show_bug.cgi?id=247295 rdar://100894959 Reviewed by Sihui Liu. * Source/WebKit/WebProcess/WebCoreSupport/WebPermissionController.cpp: (WebKit::WebPermissionController::tryProcessingRequests): * Source/WebKit/WebProcess/WebCoreSupport/WebPermissionController.h: Canonical link: https://commits.webkit.org/256298@main
c9f3c29
to
0310eb3
Compare
Committed 256298@main (0310eb3): https://commits.webkit.org/256298@main Reviewed commits have been landed. Closing PR #5984 and removing active labels. |
0310eb3
c9f3c29
π§ͺ api-iosπ§ͺ api-macπ§ͺ mac-wk1π§ͺ mac-AS-debug-wk2