-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Clean up Win32Handle implementation #13611
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
Clean up Win32Handle implementation #13611
Conversation
EWS run on previous version of this PR (hash a729953) |
a729953
to
e38e2b0
Compare
EWS run on previous version of this PR (hash e38e2b0) |
e38e2b0
to
5ec8245
Compare
EWS run on previous version of this PR (hash 5ec8245) |
I don't know why |
Its more about explicit ownership and being very explicit when you're duplicating a handle which follows along with what is happening in the |
5ec8245
to
cdc45d2
Compare
EWS run on previous version of this PR (hash cdc45d2) |
Source/WTF/wtf/win/Win32Handle.h
Outdated
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.
I think all handle like objects should be eventually have the same interface:
Win32Handle, MachSendRight, UnixFileDescriptor.
For adoption tag: I'd prefer the unfication happens in other direction, e.g. removal of the public adoption constructor and tag.
All webkit types seem to use specific adoption constructor function:
- MachSendRight::adopt
- adoptRef(T*)
- others
This means that there is no other precedent to use adopt tag except UnixFileDescriptor.
Instead, I'd propose we have:
- Win32Handle::adopt
- UnixFileDescriptor::adopt
- MachSendRight::adopt
cdc45d2
to
e0a1ca3
Compare
EWS run on previous version of this PR (hash e0a1ca3) |
Source/WTF/wtf/win/Win32Handle.h
Outdated
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.
This isn't needed. Please remove it.
Source/WTF/wtf/win/Win32Handle.h
Outdated
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.
This isn't needed. Please remove it.
Source/WTF/wtf/win/Win32Handle.h
Outdated
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.
This isn't needed. Please remove it.
Source/WTF/wtf/win/Win32Handle.cpp
Outdated
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.
This isn't needed. Please remove it. Move this code to copy()
.
e0a1ca3
to
fdfe305
Compare
EWS run on previous version of this PR (hash fdfe305) |
fdfe305
to
cef6e5b
Compare
EWS run on current version of this PR (hash cef6e5b) |
https://bugs.webkit.org/show_bug.cgi?id=256498 Reviewed by Fujii Hironori. Make `Win32Handle` look like `MachSendPort` so it has a similar interface. * Source/WTF/wtf/PlatformWin.cmake: * Source/WTF/wtf/win/MemoryFootprintWin.cpp: * Source/WTF/wtf/win/MemoryPressureHandlerWin.cpp: * Source/WTF/wtf/win/Win32Handle.cpp: Added. * Source/WTF/wtf/win/Win32Handle.h: * Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: * Source/WebKit/Platform/IPC/Connection.h: * Source/WebKit/Platform/IPC/win/ArgumentCodersWin.cpp: * Source/WebKit/Platform/IPC/win/ConnectionWin.cpp: * Source/WebKit/Platform/IPC/win/IPCSemaphoreWin.cpp: * Source/WebKit/Platform/win/SharedMemoryWin.cpp: * Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp: Canonical link: https://commits.webkit.org/263991@main
cef6e5b
to
5841938
Compare
Committed 263991@main (5841938): https://commits.webkit.org/263991@main Reviewed commits have been landed. Closing PR #13611 and removing active labels. |
return INVALID_HANDLE_VALUE; | ||
|
||
auto processHandle = ::GetCurrentProcess(); | ||
HANDLE duplicate; |
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.
If the call fails, you might have uninitialized value here.. The docs don't say..
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.
Good point. Filed https://bugs.webkit.org/show_bug.cgi?id=257435
5841938
cef6e5b
🧪 mac-AS-debug-wk2