Summary: | [Unix] Adopt UnixFileDescriptor in IPC::Attachment | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Zan Dobersek <zan> | ||||||||||
Component: | New Bugs | Assignee: | Zan Dobersek <zan> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | aperez, cgarcia, ews-watchlist, hi, joepeck, pangle, webkit-bug-importer, zdobersek | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=238726 | ||||||||||||
Attachments: |
|
Description
Zan Dobersek
2022-04-05 06:06:53 PDT
Created attachment 456697 [details]
Patch
Comment on attachment 456697 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456697&action=review It seems there's a caller missing in GTK. > Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp:520 > + if (!!attachments[i].fd()) { I think it's worth adding Attachment::isValid() or isNull() or bool operator Created attachment 456796 [details]
Patch for landing
Comment on attachment 456796 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=456796&action=review > Source/WebKit/Shared/glib/UserMessage.cpp:94 > - if (g_unix_fd_list_append(result.fileDescriptors.get(), attachment.releaseFileDescriptor(), nullptr) == -1) > + if (g_unix_fd_list_append(result.fileDescriptors.get(), attachment.fd().release(), nullptr) == -1) Now that I see this again, I find a bit weird that the returned fd that it's still owned by the attachment can be released. Could we remove the non const getter and make attachment.release().release() instead? or maybe keep the releaseFileDescriptor() method in attachment that returns m_fd.release() instead? Created attachment 456801 [details]
Patch for landing
Less getters, more releasing.
Created attachment 456806 [details]
Patch for landing
Fixed the reviewed-by line.
Comment on attachment 456806 [details] Patch for landing Clearing flags on attachment: 456806 Committed r292458 (249309@trunk): <https://commits.webkit.org/249309@trunk> All reviewed patches have been landed. Closing bug. |