void CompositingManager::establishConnection(WebPage& webPage, WTF::RunLoop& runLoop) { IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection(); IPC::Connection::Identifier connectionIdentifier(socketPair.server); IPC::Attachment connectionClientPort(socketPair.client); m_connection = IPC::Connection::createServerConnection(connectionIdentifier, *this, runLoop); m_connection->open(); webPage.sendSync(Messages::CompositingManagerProxy::EstablishConnection(connectionClientPort), Messages::CompositingManagerProxy::EstablishConnection::Reply(), webPage.pageID()); }
// Called from WebInspectorClient void WebInspector::createInspectorPage(bool underTest) { #if OS(DARWIN) mach_port_t listeningPort; mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort); IPC::Connection::Identifier connectionIdentifier(listeningPort); IPC::Attachment connectionClientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND); #elif USE(UNIX_DOMAIN_SOCKETS) IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection(); IPC::Connection::Identifier connectionIdentifier(socketPair.server); IPC::Attachment connectionClientPort(socketPair.client); #else notImplemented(); return; #endif m_frontendConnection = IPC::Connection::createServerConnection(connectionIdentifier, *this); m_frontendConnection->open(); WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::CreateInspectorPage(connectionClientPort, canAttachWindow(), underTest), m_page->pageID()); }