RESOLVED FIXED 240056
SharedMemory::IPCHandle is a redundant class
https://bugs.webkit.org/show_bug.cgi?id=240056
Summary SharedMemory::IPCHandle is a redundant class
Kimmo Kinnunen
Reported 2022-05-04 01:22:44 PDT
SharedMemory::IPCHandle is a redundant class
Attachments
Patch (154.44 KB, patch)
2022-05-04 01:33 PDT, Kimmo Kinnunen
ews-feeder: commit-queue-
Patch (153.94 KB, patch)
2022-05-04 04:02 PDT, Kimmo Kinnunen
no flags
Patch (153.94 KB, patch)
2022-05-04 10:56 PDT, Kimmo Kinnunen
ews-feeder: commit-queue-
Patch (153.93 KB, patch)
2022-05-04 11:54 PDT, Kimmo Kinnunen
no flags
Patch (153.75 KB, patch)
2022-05-05 05:07 PDT, Kimmo Kinnunen
no flags
Patch (156.58 KB, patch)
2022-05-13 00:07 PDT, Kimmo Kinnunen
ews-feeder: commit-queue-
Patch (157.13 KB, patch)
2022-05-13 04:51 PDT, Kimmo Kinnunen
no flags
Patch (157.12 KB, patch)
2022-05-13 09:16 PDT, Kimmo Kinnunen
Hironori.Fujii: review+
Kimmo Kinnunen
Comment 1 2022-05-04 01:33:17 PDT
Kimmo Kinnunen
Comment 2 2022-05-04 04:02:18 PDT
Kimmo Kinnunen
Comment 3 2022-05-04 10:56:25 PDT
Kimmo Kinnunen
Comment 4 2022-05-04 11:54:12 PDT
Kimmo Kinnunen
Comment 5 2022-05-05 05:07:23 PDT
Radar WebKit Bug Importer
Comment 6 2022-05-11 01:23:13 PDT
Fujii Hironori
Comment 7 2022-05-12 14:33:48 PDT
Comment on attachment 458866 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458866&action=review Very nice! > Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp:263 > + if (!roundedSize) { How this condition can fail? Handle::decode already checks the size. Do you want to use UNLIKELY here? > Source/WebKit/Platform/unix/SharedMemoryUnix.cpp:84 > + encoder << const_cast<Handle*>(this)->releaseAttachment(); Why do you need const_cast here? releaseAttachment is a const method.
Fujii Hironori
Comment 8 2022-05-12 14:49:04 PDT
Comment on attachment 458866 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458866&action=review > Source/WebKit/Shared/ShareableBitmap.cpp:51 > + encoder << WTFMove(m_handle); IUUC, WTFMove has no effect here. "encoder << m_handle;" works same here. > Source/WebKit/Shared/ShareableResource.cpp:41 > + encoder << WTFMove(m_handle); Ditto.
Kimmo Kinnunen
Comment 9 2022-05-13 00:07:43 PDT
Kimmo Kinnunen
Comment 10 2022-05-13 00:12:25 PDT
(In reply to Fujii Hironori from comment #8) > Comment on attachment 458866 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=458866&action=review > > > Source/WebKit/Shared/ShareableBitmap.cpp:51 > > + encoder << WTFMove(m_handle); > > IUUC, WTFMove has no effect here. "encoder << m_handle;" works same here. > Thanks for looking! Yeah, you are right. I was needlessly thinking ahead. Added your suggestions. For the slightly redundant safeRoundPage, it is just to preserve the existing logic. I'll change this and other similar cases after this refactor.
Fujii Hironori
Comment 11 2022-05-13 00:28:39 PDT
Comment on attachment 459281 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=459281&action=review > Source/WebKit/Shared/WebCompiledContentRuleListData.cpp:47 > + encoder << WTFMove(handle); encoder << handle; > Source/WebKit/Shared/WebCoreArgumentCoders.cpp:193 > + encoder << WTFMove(handle); encoder << handle; > Source/WebKit/Shared/WebHitTestResultData.cpp:130 > + encoder << WTFMove(imageHandle); encoder << imageHandle; > Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:700 > }); WTFMove isn't needed for simple return statements. return handle;
Kimmo Kinnunen
Comment 12 2022-05-13 04:51:53 PDT
Kimmo Kinnunen
Comment 13 2022-05-13 09:16:29 PDT
Fujii Hironori
Comment 14 2022-05-16 14:17:06 PDT
Comment on attachment 459305 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=459305&action=review > Source/WebKit/Shared/WebCompiledContentRuleListData.cpp:37 > + return topURLFiltersBytecodeOffset + topURLFiltersBytecodeSize; Do you think this addition needs overflow checking? > Source/WebKit/Shared/WebCompiledContentRuleListData.cpp:112 > + if (data->size() < ruleListDataSize(*topURLFiltersBytecodeOffset, *topURLFiltersBytecodeSize)) data->size() is a data size, not buffer size. I think it should (data->size() == ruleListDataSize(...)). If the condition fails, something wrong happens. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:556 > + title = @""; Do you want to change MiniBrowser in this patch?
Kimmo Kinnunen
Comment 15 2022-08-15 05:55:48 PDT
EWS
Comment 16 2022-08-17 00:32:10 PDT
Committed 253508@main (29dff38a6ecb): <https://commits.webkit.org/253508@main> Reviewed commits have been landed. Closing PR #3304 and removing active labels.
Kimmo Kinnunen
Comment 17 2022-08-22 04:39:30 PDT
Re-opening for pull request https://github.com/WebKit/WebKit/pull/3531
EWS
Comment 18 2022-08-23 03:21:12 PDT
Committed 253680@main (5d61da99e4fe): <https://commits.webkit.org/253680@main> Reviewed commits have been landed. Closing PR #3531 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.