diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
tree | 73dc228333948738bbe02976cacca8cd382bc978 /Source/WebKit2/Platform | |
parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebKit2/Platform')
-rw-r--r-- | Source/WebKit2/Platform/CoreIPC/Connection.h | 41 | ||||
-rw-r--r-- | Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp | 19 |
2 files changed, 57 insertions, 3 deletions
diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.h b/Source/WebKit2/Platform/CoreIPC/Connection.h index da9a08a3c..ddf591f32 100644 --- a/Source/WebKit2/Platform/CoreIPC/Connection.h +++ b/Source/WebKit2/Platform/CoreIPC/Connection.h @@ -40,6 +40,9 @@ #if OS(DARWIN) #include <mach/mach_port.h> +#if HAVE(XPC) +#include <xpc/xpc.h> +#endif #elif PLATFORM(WIN) #include <string> #elif PLATFORM(QT) @@ -114,12 +117,44 @@ public: }; #if OS(DARWIN) - typedef mach_port_t Identifier; + struct Identifier { + Identifier() + : port(MACH_PORT_NULL) +#if HAVE(XPC) + , xpcConnection(0) +#endif + { + } + + Identifier(mach_port_t port) + : port(port) +#if HAVE(XPC) + , xpcConnection(0) +#endif + { + } + +#if HAVE(XPC) + Identifier(mach_port_t port, xpc_connection_t xpcConnection) + : port(port) + , xpcConnection(xpcConnection) + { + } +#endif + + mach_port_t port; +#if HAVE(XPC) + xpc_connection_t xpcConnection; +#endif + }; + static bool identifierIsNull(Identifier identifier) { return identifier.port == MACH_PORT_NULL; } #elif PLATFORM(WIN) typedef HANDLE Identifier; static bool createServerAndClientIdentifiers(Identifier& serverIdentifier, Identifier& clientIdentifier); + static bool identifierIsNull(Identifier identifier) { return !identifier; } #elif USE(UNIX_DOMAIN_SOCKETS) typedef int Identifier; + static bool identifierIsNull(Identifier identifier) { return !identifier; } #endif static PassRefPtr<Connection> createServerConnection(Identifier, Client*, WebCore::RunLoop* clientRunLoop); @@ -337,6 +372,10 @@ private: // the exception port that exceptions from the other end will be sent on. mach_port_t m_exceptionPort; +#if HAVE(XPC) + xpc_connection_t m_xpcConnection; +#endif + #elif PLATFORM(WIN) // Called on the connection queue. void readEventHandler(); diff --git a/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp b/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp index 1119a2847..3db1b83d7 100644 --- a/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp +++ b/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp @@ -33,6 +33,10 @@ #include <mach/mach_error.h> #include <mach/vm_map.h> +#if HAVE(XPC) +#include <xpc/xpc.h> +#endif + using namespace std; using namespace WebCore; @@ -65,6 +69,13 @@ void Connection::platformInvalidate() m_connectionQueue.unregisterMachPortEventHandler(m_exceptionPort); m_exceptionPort = MACH_PORT_NULL; } + +#if HAVE(XPC) + if (m_xpcConnection) { + xpc_release(m_xpcConnection); + m_xpcConnection = 0; + } +#endif } void Connection::platformInitialize(Identifier identifier) @@ -72,12 +83,16 @@ void Connection::platformInitialize(Identifier identifier) m_exceptionPort = MACH_PORT_NULL; if (m_isServer) { - m_receivePort = identifier; + m_receivePort = identifier.port; m_sendPort = MACH_PORT_NULL; } else { m_receivePort = MACH_PORT_NULL; - m_sendPort = identifier; + m_sendPort = identifier.port; } + +#if HAVE(XPC) + m_xpcConnection = identifier.xpcConnection; +#endif } bool Connection::open() |