Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Make IPC::Attachment moveable on DARWIN
https://bugs.webkit.org/show_bug.cgi?id=241660 This makes the DARWIN implementation of IPC::Attachment use MachSendPort, since this proper move handling, and lifetime management of the underlying mach_port_t. This also removes the MachPort class, since this was largely just used as an intermediate and is stricly worse than MachSendPort. The primary bug fixed here is a case where the WebProcess sent a port to the UIProcess, and then we failed to forward it to the GPUProcess since it had crashed. Previously we'd just leak the port (and thus never notify the WebContent process that we'd failed), whereas now it gets released correctly. Reviewed by Kimmo Kinnunen. * Source/WebKit/GPUProcess/GPUProcess.cpp: (WebKit::asConnectionIdentifier): (WebKit::GPUProcess::createGPUConnectionToWebProcess): * Source/WebKit/Platform/IPC/Attachment.cpp: (IPC::Attachment::Attachment): (IPC::Attachment::release): Deleted. * Source/WebKit/Platform/IPC/Attachment.h: (IPC::Attachment::Attachment::customWriter const): (IPC::Attachment::Attachment): Deleted. (IPC::Attachment::type const): Deleted. (IPC::Attachment::isNull const): Deleted. (IPC::Attachment::size const): Deleted. (IPC::Attachment::fd const): Deleted. (IPC::Attachment::release): Deleted. (IPC::Attachment::customWriter const): Deleted. (IPC::Attachment::port const): Deleted. (IPC::Attachment::disposition const): Deleted. (IPC::Attachment::handle const): Deleted. * Source/WebKit/Platform/IPC/StreamServerConnection.cpp: (IPC::StreamServerConnection::createWithDedicatedConnection): * Source/WebKit/Platform/IPC/cocoa/MachPort.h: Removed. * Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp: (WebKit::SharedMemory::IPCHandle::encode const): (WebKit::SharedMemory::IPCHandle::decode): * Source/WebKit/Scripts/webkit/parser_unittest.py: * Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp: (IPC::messageArgumentDescriptions): * Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiver.messages.in: * Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp: * Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessages.h: (Messages::TestWithLegacyReceiver::DidCreateWebProcessConnection::DidCreateWebProcessConnection): * Source/WebKit/Scripts/webkit/tests/TestWithoutAttributes.messages.in: * Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp: * Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessages.h: (Messages::TestWithoutAttributes::DidCreateWebProcessConnection::DidCreateWebProcessConnection): * Source/WebKit/Shared/IPCConnectionTester.cpp: (WebKit::asIdentifier): * Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder<MachSendRight>::encode): (IPC::ArgumentCoder<MachSendRight>::decode): * Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp: * Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getNetworkProcessConnection): * Source/WebKit/WebKit.xcodeproj/project.pbxproj: * Source/WebKit/WebProcess/Inspector/WebInspector.cpp: (WebKit::WebInspector::setFrontendConnection): * Source/WebKit/WebProcess/Network/NetworkProcessConnectionInfo.h: (WebKit::NetworkProcessConnectionInfo::identifier const): (WebKit::NetworkProcessConnectionInfo::releaseIdentifier): Converts IPC::Attachment to use MachSendPort instead of a port/disposition pair, and changes all callsites to handle that. * Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::Connection::open): (IPC::Connection::sendOutgoingMessage): (IPC::createMessageDecoder): (IPC::Connection::receiveSourceEventHandler): (IPC::Connection::createConnectionIdentifierPair): Make serialization/deserialization handle IPC::Connection being a MachSendPort. Also makes sure we explicity allocate a send right at the two places we allocate a receive right, rather than relying on this happening during serialization (with the MAKE_SEND disposition). This means if the caller ends up not sending the IPC::Connection due to an error, we'll still end up deallocating a send right, and trigger the associated notifications. * Source/WebKit/Platform/IPC/cocoa/SharedFileHandleCocoa.cpp: (IPC::SharedFileHandle::encode const): (IPC::SharedFileHandle::decode): Fixes a potential leak where we previously just passed our port to fileport_makefd without then releasing our reference to it (which is now handled via the MachSendPort destructor). * Source/WTF/wtf/cocoa/MachSendRight.cpp: (WTF::MachSendRight::operator=): Fixes a potential leak, where we were just overwriting the old m_port contents without releasing it. Canonical link: https://commits.webkit.org/251671@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
a440dc2
commit 16972b8
Showing
26 changed files
with
261 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.