Diff
Modified: trunk/Source/WebCore/ChangeLog (177592 => 177593)
--- trunk/Source/WebCore/ChangeLog 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebCore/ChangeLog 2014-12-19 21:48:38 UTC (rev 177593)
@@ -1,3 +1,12 @@
+2014-12-19 Anders Carlsson <[email protected]>
+
+ Use WebCore::MachSendRights for the compositing render server port
+ https://bugs.webkit.org/show_bug.cgi?id=139834
+
+ Reviewed by Tim Horton.
+
+ * WebCore.exp.in:
+
2014-12-19 Chris Dumez <[email protected]>
[iOS] Log how often media element playback happens using FeatureCounter
Modified: trunk/Source/WebCore/WebCore.exp.in (177592 => 177593)
--- trunk/Source/WebCore/WebCore.exp.in 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-12-19 21:48:38 UTC (rev 177593)
@@ -326,6 +326,7 @@
__ZN7WebCore13KeyboardEventC1Ev
__ZN7WebCore13MachSendRight13leakSendRightEv
__ZN7WebCore13MachSendRight5adoptEj
+__ZN7WebCore13MachSendRight6createEj
__ZN7WebCore13MachSendRightD1Ev
__ZN7WebCore13MachSendRightaSEOS0_
__ZN7WebCore13NodeTraversal13deepLastChildEPNS_4NodeE
@@ -1706,6 +1707,7 @@
__ZNK7WebCore13HitTestResult5titleERNS_13TextDirectionE
__ZNK7WebCore13HitTestResult9imageRectEv
__ZNK7WebCore13ImageDocument12imageElementEv
+__ZNK7WebCore13MachSendRight13copySendRightEv
__ZNK7WebCore13ResourceError7cfErrorEv
__ZNK7WebCore13ResourceError7nsErrorEv
__ZNK7WebCore13ResourceErrorcvP7NSErrorEv
@@ -2490,8 +2492,8 @@
#if PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
__ZN7WebCore7IntSizeC1ERK7_NSSize
+__ZN7WebCore9FloatSizeC1ERK7_NSSize
__ZNK7WebCore7IntSizecv7_NSSizeEv
-__ZN7WebCore9FloatSizeC1ERK7_NSSize
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
Modified: trunk/Source/WebKit2/ChangeLog (177592 => 177593)
--- trunk/Source/WebKit2/ChangeLog 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/ChangeLog 2014-12-19 21:48:38 UTC (rev 177593)
@@ -1,3 +1,53 @@
+2014-12-19 Anders Carlsson <[email protected]>
+
+ Use WebCore::MachSendRights for the compositing render server port
+ https://bugs.webkit.org/show_bug.cgi?id=139834
+
+ Reviewed by Tim Horton.
+
+ * Platform/IPC/HandleMessage.h:
+ (IPC::callMemberFunctionImpl):
+ * Platform/mac/LayerHostingContext.h:
+ * Platform/mac/LayerHostingContext.mm:
+ (WebKit::LayerHostingContext::createForPort):
+ * PluginProcess/PluginControllerProxy.h:
+ * PluginProcess/PluginProcess.cpp:
+ (WebKit::PluginProcess::PluginProcess):
+ (WebKit::PluginProcess::initializePluginProcess):
+ * PluginProcess/PluginProcess.h:
+ (WebKit::PluginProcess::compositingRenderServerPort):
+ * PluginProcess/mac/PluginControllerProxyMac.mm:
+ (WebKit::PluginControllerProxy::compositingRenderServerPort):
+ * PluginProcess/mac/PluginProcessMac.mm:
+ (WebKit::PluginProcess::platformInitializePluginProcess):
+ * Shared/Plugins/PluginProcessCreationParameters.cpp:
+ * Shared/Plugins/PluginProcessCreationParameters.h:
+ * Shared/WebCoreArgumentCoders.h:
+ * Shared/WebProcessCreationParameters.h:
+ * Shared/mac/WebCoreArgumentCodersMac.mm:
+ (IPC::ArgumentCoder<MachSendRight>::encode):
+ * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
+ (WebKit::PluginProcessProxy::platformInitializePluginProcess):
+ * UIProcess/mac/WebContextMac.mm:
+ (WebKit::WebContext::platformInitializeWebProcess):
+ * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+ (WebKit::NPN_GetValue):
+ * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+ * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+ (WebKit::NetscapePlugin::compositingRenderServerPort):
+ (WebKit::NetscapePlugin::setLayerHostingMode):
+ * WebProcess/Plugins/PluginController.h:
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::compositingRenderServerPort):
+ * WebProcess/Plugins/PluginView.h:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::WebProcess):
+ (WebKit::WebProcess::initializeWebProcess):
+ * WebProcess/WebProcess.h:
+ (WebKit::WebProcess::compositingRenderServerPort):
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+
2014-12-19 Andreas Kling <[email protected]>
Ref-ify TextIterator API.
Modified: trunk/Source/WebKit2/Platform/IPC/HandleMessage.h (177592 => 177593)
--- trunk/Source/WebKit2/Platform/IPC/HandleMessage.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Platform/IPC/HandleMessage.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -13,7 +13,7 @@
template <typename C, typename MF, typename ArgsTuple, size_t... ArgsIndex>
void callMemberFunctionImpl(C* object, MF function, ArgsTuple&& args, std::index_sequence<ArgsIndex...>)
{
- (object->*function)(std::get<ArgsIndex>(args)...);
+ (object->*function)(std::get<ArgsIndex>(std::forward<ArgsTuple>(args))...);
}
template<typename C, typename MF, typename ArgsTuple, typename ArgsIndicies = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
@@ -83,7 +83,7 @@
template <typename C, typename MF, typename ArgsTuple, size_t... ArgsIndex>
void callMemberFunctionImpl(C* object, MF function, MessageDecoder& decoder, ArgsTuple&& args, std::index_sequence<ArgsIndex...>)
{
- (object->*function)(std::get<ArgsIndex>(args)..., decoder);
+ (object->*function)(std::get<ArgsIndex>(std::forward<ArgsTuple>(args))..., decoder);
}
template<typename C, typename MF, typename ArgsTuple, typename ArgsIndicies = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
Modified: trunk/Source/WebKit2/Platform/mac/LayerHostingContext.h (177592 => 177593)
--- trunk/Source/WebKit2/Platform/mac/LayerHostingContext.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Platform/mac/LayerHostingContext.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -34,12 +34,16 @@
OBJC_CLASS CALayer;
OBJC_CLASS CAContext;
+namespace WebCore {
+class MachSendRight;
+}
+
namespace WebKit {
class LayerHostingContext {
WTF_MAKE_NONCOPYABLE(LayerHostingContext);
public:
- static std::unique_ptr<LayerHostingContext> createForPort(mach_port_t serverPort);
+ static std::unique_ptr<LayerHostingContext> createForPort(const WebCore::MachSendRight& serverPort);
#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess();
#endif
Modified: trunk/Source/WebKit2/Platform/mac/LayerHostingContext.mm (177592 => 177593)
--- trunk/Source/WebKit2/Platform/mac/LayerHostingContext.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Platform/mac/LayerHostingContext.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -26,17 +26,20 @@
#import "config.h"
#import "LayerHostingContext.h"
+#import <WebCore/MachSendRight.h>
#import <WebCore/QuartzCoreSPI.h>
#import <WebKitSystemInterface.h>
+using namespace WebCore;
+
namespace WebKit {
-std::unique_ptr<LayerHostingContext> LayerHostingContext::createForPort(mach_port_t serverPort)
+std::unique_ptr<LayerHostingContext> LayerHostingContext::createForPort(const MachSendRight& serverPort)
{
auto layerHostingContext = std::make_unique<LayerHostingContext>();
layerHostingContext->m_layerHostingMode = LayerHostingMode::InProcess;
- layerHostingContext->m_context = (CAContext *)WKCAContextMakeRemoteWithServerPort(serverPort);
+ layerHostingContext->m_context = (CAContext *)WKCAContextMakeRemoteWithServerPort(serverPort.sendRight());
return layerHostingContext;
}
Modified: trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h (177592 => 177593)
--- trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -103,7 +103,7 @@
#if PLATFORM(COCOA)
virtual void pluginFocusOrWindowFocusChanged(bool) override;
virtual void setComplexTextInputState(PluginComplexTextInputState) override;
- virtual mach_port_t compositingRenderServerPort() override;
+ virtual const WebCore::MachSendRight& compositingRenderServerPort() override;
virtual void openPluginPreferencePane() override;
#endif
Modified: trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp (177592 => 177593)
--- trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp 2014-12-19 21:48:38 UTC (rev 177593)
@@ -57,9 +57,6 @@
PluginProcess::PluginProcess()
: m_supportsAsynchronousPluginInitialization(false)
, m_minimumLifetimeTimer(RunLoop::main(), this, &PluginProcess::minimumLifetimeTimerFired)
-#if PLATFORM(COCOA)
- , m_compositingRenderServerPort(MACH_PORT_NULL)
-#endif
, m_connectionActivity("PluginProcess connection activity.")
{
NetscapePlugin::setSetExceptionFunction(WebProcessConnection::setGlobalException);
@@ -139,7 +136,7 @@
{
}
-void PluginProcess::initializePluginProcess(const PluginProcessCreationParameters& parameters)
+void PluginProcess::initializePluginProcess(PluginProcessCreationParameters&& parameters)
{
ASSERT(!m_pluginModule);
@@ -147,7 +144,7 @@
setMinimumLifetime(parameters.minimumLifetime);
setTerminationTimeout(parameters.terminationTimeout);
- platformInitializePluginProcess(parameters);
+ platformInitializePluginProcess(WTF::move(parameters));
}
void PluginProcess::createWebProcessConnection()
Modified: trunk/Source/WebKit2/PluginProcess/PluginProcess.h (177592 => 177593)
--- trunk/Source/WebKit2/PluginProcess/PluginProcess.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/PluginProcess/PluginProcess.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -31,6 +31,7 @@
#include "ChildProcess.h"
#include <WebCore/CountedUserActivity.h>
#include <WebCore/AudioHardwareListener.h>
+#include <WebCore/MachSendRight.h>
#include <wtf/Forward.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/text/WTFString.h>
@@ -58,7 +59,7 @@
void setModalWindowIsShowing(bool);
void setFullscreenWindowIsShowing(bool);
- mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; }
+ const WebCore::MachSendRight& compositingRenderServerPort() const { return m_compositingRenderServerPort; }
bool launchProcess(const String& launchPath, const Vector<String>& arguments);
bool launchApplicationAtURL(const String& urlString, const Vector<String>& arguments);
@@ -90,7 +91,7 @@
// Message handlers.
void didReceivePluginProcessMessage(IPC::Connection*, IPC::MessageDecoder&);
- void initializePluginProcess(const PluginProcessCreationParameters&);
+ void initializePluginProcess(PluginProcessCreationParameters&&);
void createWebProcessConnection();
void getSitesWithData(uint64_t callbackID);
void clearSiteData(const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID);
@@ -100,7 +101,7 @@
virtual void audioHardwareDidBecomeInactive() override;
virtual void audioOutputDeviceChanged() override { }
- void platformInitializePluginProcess(const PluginProcessCreationParameters&);
+ void platformInitializePluginProcess(PluginProcessCreationParameters&&);
void setMinimumLifetime(double);
void minimumLifetimeTimerFired();
@@ -123,7 +124,7 @@
#if PLATFORM(COCOA)
// The Mach port used for accelerated compositing.
- mach_port_t m_compositingRenderServerPort;
+ WebCore::MachSendRight m_compositingRenderServerPort;
String m_nsurlCacheDirectory;
#endif
Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm (177592 => 177593)
--- trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -50,7 +50,7 @@
m_connection->connection()->send(Messages::PluginProxy::SetComplexTextInputState(pluginComplexTextInputState), m_pluginInstanceID, IPC::DispatchMessageEvenWhenWaitingForSyncReply);
}
-mach_port_t PluginControllerProxy::compositingRenderServerPort()
+const MachSendRight& PluginControllerProxy::compositingRenderServerPort()
{
return PluginProcess::shared().compositingRenderServerPort();
}
Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm (177592 => 177593)
--- trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -404,9 +404,9 @@
ASSERT_UNUSED(result, result == noErr);
}
-void PluginProcess::platformInitializePluginProcess(const PluginProcessCreationParameters& parameters)
+void PluginProcess::platformInitializePluginProcess(PluginProcessCreationParameters&& parameters)
{
- m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
+ m_compositingRenderServerPort = WTF::move(parameters.acceleratedCompositingPort);
if (parameters.processType == PluginProcessTypeSnapshot)
muteAudio();
Modified: trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp (177592 => 177593)
--- trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp 2014-12-19 21:48:38 UTC (rev 177593)
@@ -28,7 +28,7 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
-#include "ArgumentCoders.h"
+#include "WebCoreArgumentCoders.h"
namespace WebKit {
Modified: trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h (177592 => 177593)
--- trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -31,12 +31,12 @@
#include "PluginProcessAttributes.h"
#if PLATFORM(COCOA)
-#include "MachPort.h"
+#include <WebCore/MachSendRight.h>
#endif
namespace IPC {
- class ArgumentDecoder;
- class ArgumentEncoder;
+class ArgumentDecoder;
+class ArgumentEncoder;
}
namespace WebKit {
@@ -54,7 +54,7 @@
double terminationTimeout;
#if PLATFORM(COCOA)
- IPC::MachPort acceleratedCompositingPort;
+ WebCore::MachSendRight acceleratedCompositingPort;
#endif
};
Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (177592 => 177593)
--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -273,6 +273,7 @@
#if PLATFORM(COCOA)
template<> struct ArgumentCoder<WebCore::MachSendRight> {
+ static void encode(ArgumentEncoder&, const WebCore::MachSendRight&);
static void encode(ArgumentEncoder&, WebCore::MachSendRight&&);
static bool decode(ArgumentDecoder&, WebCore::MachSendRight&);
};
Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (177592 => 177593)
--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -29,6 +29,7 @@
#include "CacheModel.h"
#include "SandboxExtension.h"
#include "TextCheckerState.h"
+#include <WebCore/MachSendRight.h>
#include <WebCore/SessionIDHash.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
@@ -130,7 +131,7 @@
uint64_t nsURLCacheMemoryCapacity;
uint64_t nsURLCacheDiskCapacity;
- IPC::MachPort acceleratedCompositingPort;
+ WebCore::MachSendRight acceleratedCompositingPort;
String uiProcessBundleResourcePath;
SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
Modified: trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm (177592 => 177593)
--- trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -368,6 +368,11 @@
return true;
}
+void ArgumentCoder<MachSendRight>::encode(ArgumentEncoder& encoder, const MachSendRight& sendRight)
+{
+ encoder << Attachment(sendRight.copySendRight().leakSendRight(), MACH_MSG_TYPE_MOVE_SEND);
+}
+
void ArgumentCoder<MachSendRight>::encode(ArgumentEncoder& encoder, MachSendRight&& sendRight)
{
encoder << Attachment(sendRight.leakSendRight(), MACH_MSG_TYPE_MOVE_SEND);
Modified: trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm (177592 => 177593)
--- trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -168,9 +168,7 @@
parameters.supportsAsynchronousPluginInitialization = m_pluginProcessAttributes.moduleInfo.bundleIdentifier == "com.macromedia.Flash Player.plugin";
#if HAVE(HOSTED_CORE_ANIMATION)
- mach_port_t renderServerPort = [[CARemoteLayerServer sharedServer] serverPort];
- if (renderServerPort != MACH_PORT_NULL)
- parameters.acceleratedCompositingPort = IPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND);
+ parameters.acceleratedCompositingPort = MachSendRight::create([CARemoteLayerServer sharedServer].serverPort);
#endif
}
Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm (177592 => 177593)
--- trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -188,9 +188,7 @@
#if HAVE(HOSTED_CORE_ANIMATION)
#if !PLATFORM(IOS)
- mach_port_t renderServerPort = [[CARemoteLayerServer sharedServer] serverPort];
- if (renderServerPort != MACH_PORT_NULL)
- parameters.acceleratedCompositingPort = IPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND);
+ parameters.acceleratedCompositingPort = MachSendRight::create([CARemoteLayerServer sharedServer].serverPort);
#endif
#endif
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp 2014-12-19 21:48:38 UTC (rev 177593)
@@ -34,6 +34,7 @@
#include <WebCore/HTTPHeaderMap.h>
#include <WebCore/HTTPHeaderNames.h>
#include <WebCore/IdentifierRep.h>
+#include <WebCore/MachSendRight.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/ProtectionSpace.h>
#include <WebCore/SharedBuffer.h>
@@ -489,7 +490,7 @@
case WKNVCALayerRenderServerPort: {
RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
- *(mach_port_t*)value = plugin->compositingRenderServerPort();
+ *(mach_port_t*)value = plugin->compositingRenderServerPort().sendRight();
break;
}
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -39,9 +39,10 @@
#include <wtf/text/StringHash.h>
namespace WebCore {
- class HTTPHeaderMap;
- class ProtectionSpace;
- class SharedBuffer;
+class MachSendRight;
+class HTTPHeaderMap;
+class ProtectionSpace;
+class SharedBuffer;
}
OBJC_CLASS WKNPAPIPlugInContainer;
@@ -71,7 +72,7 @@
bool hasHandledAKeyDownEvent() const { return m_hasHandledAKeyDownEvent; }
- mach_port_t compositingRenderServerPort();
+ const WebCore::MachSendRight& compositingRenderServerPort();
void openPluginPreferencePane();
// Computes an affine transform from the given coordinate space to the screen coordinate space.
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -34,6 +34,7 @@
#import "WebEvent.h"
#import <Carbon/Carbon.h>
#import <WebCore/GraphicsContext.h>
+#import <WebCore/MachSendRight.h>
#import <WebCore/NotImplemented.h>
#import <WebKitSystemInterface.h>
#import <wtf/NeverDestroyed.h>
@@ -170,11 +171,14 @@
return NPERR_NO_ERROR;
}
-mach_port_t NetscapePlugin::compositingRenderServerPort()
+const MachSendRight& NetscapePlugin::compositingRenderServerPort()
{
#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
- if (m_layerHostingMode == LayerHostingMode::OutOfProcess)
- return MACH_PORT_NULL;
+ if (m_layerHostingMode == LayerHostingMode::OutOfProcess) {
+ static NeverDestroyed<MachSendRight> sendRight;
+
+ return sendRight;
+ }
#endif
return controller()->compositingRenderServerPort();
@@ -1052,7 +1056,7 @@
m_layerHostingMode = layerHostingMode;
// Tell the plug-in about the new compositing render server port. If it returns OK we'll ask it again for a new layer.
- mach_port_t port = NetscapePlugin::compositingRenderServerPort();
+ mach_port_t port = NetscapePlugin::compositingRenderServerPort().sendRight();
if (NPP_SetValue(static_cast<NPNVariable>(WKNVCALayerRenderServerPort), &port) != NPERR_NO_ERROR)
return;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -37,10 +37,11 @@
typedef void* NPIdentifier;
namespace WebCore {
- class HTTPHeaderMap;
- class IntRect;
- class URL;
- class ProtectionSpace;
+class HTTPHeaderMap;
+class IntRect;
+class MachSendRight;
+class ProtectionSpace;
+class URL;
}
namespace WebKit {
@@ -109,7 +110,7 @@
virtual void setComplexTextInputState(PluginComplexTextInputState) = 0;
// Returns the mach port of the compositing render server.
- virtual mach_port_t compositingRenderServerPort() = 0;
+ virtual const WebCore::MachSendRight& compositingRenderServerPort() = 0;
// Open the preference pane for this plug-in (as stated in the plug-in's Info.plist).
virtual void openPluginPreferencePane() = 0;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2014-12-19 21:48:38 UTC (rev 177593)
@@ -1530,7 +1530,7 @@
m_webPage->send(Messages::WebPageProxy::SetPluginComplexTextInputState(m_plugin->pluginComplexTextInputIdentifier(), pluginComplexTextInputState));
}
-mach_port_t PluginView::compositingRenderServerPort()
+const MachSendRight& PluginView::compositingRenderServerPort()
{
return WebProcess::shared().compositingRenderServerPort();
}
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -49,6 +49,7 @@
namespace WebCore {
class Frame;
class HTMLPlugInElement;
+class MachSendRight;
class MouseEvent;
class RenderBoxModelObject;
}
@@ -205,7 +206,7 @@
#if PLATFORM(COCOA)
virtual void pluginFocusOrWindowFocusChanged(bool pluginHasFocusAndWindowHasFocus) override;
virtual void setComplexTextInputState(PluginComplexTextInputState) override;
- virtual mach_port_t compositingRenderServerPort() override;
+ virtual const WebCore::MachSendRight& compositingRenderServerPort() override;
virtual void openPluginPreferencePane() override;
#endif
virtual float contentsScaleFactor() override;
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2014-12-19 21:48:38 UTC (rev 177593)
@@ -158,7 +158,6 @@
, m_cacheModel(CacheModelDocumentViewer)
, m_diskCacheIsDisabledForTesting(false)
#if PLATFORM(COCOA)
- , m_compositingRenderServerPort(MACH_PORT_NULL)
, m_clearResourceCachesDispatchGroup(0)
#endif
, m_fullKeyboardAccessEnabled(false)
@@ -270,7 +269,7 @@
return *supplement<AuthenticationManager>();
}
-void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parameters, IPC::MessageDecoder& decoder)
+void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters, IPC::MessageDecoder& decoder)
{
ASSERT(m_pageMap.isEmpty());
@@ -278,7 +277,7 @@
m_usesNetworkProcess = parameters.usesNetworkProcess;
#endif
- platformInitializeWebProcess(parameters, decoder);
+ platformInitializeWebProcess(WTF::move(parameters), decoder);
WTF::setCurrentThreadIsUserInitiated();
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/WebProcess.h 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h 2014-12-19 21:48:38 UTC (rev 177593)
@@ -38,6 +38,7 @@
#include "ViewUpdateDispatcher.h"
#include "VisitedLinkTable.h"
#include "WebOriginDataManagerSupplement.h"
+#include <WebCore/MachSendRight.h>
#include <WebCore/SessionIDHash.h>
#include <WebCore/Timer.h>
#include <wtf/Forward.h>
@@ -115,7 +116,7 @@
InjectedBundle* injectedBundle() const { return m_injectedBundle.get(); }
#if PLATFORM(COCOA)
- mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; }
+ const WebCore::MachSendRight& compositingRenderServerPort() const { return m_compositingRenderServerPort; }
#endif
bool shouldPlugInAutoStartFromOrigin(WebPage&, const String& pageOrigin, const String& pluginOrigin, const String& mimeType);
@@ -203,8 +204,8 @@
virtual IPC::Connection* downloadProxyConnection() override;
virtual AuthenticationManager& downloadsAuthenticationManager() override;
- void initializeWebProcess(const WebProcessCreationParameters&, IPC::MessageDecoder&);
- void platformInitializeWebProcess(const WebProcessCreationParameters&, IPC::MessageDecoder&);
+ void initializeWebProcess(WebProcessCreationParameters&&, IPC::MessageDecoder&);
+ void platformInitializeWebProcess(WebProcessCreationParameters&&, IPC::MessageDecoder&);
void platformTerminate();
void registerURLSchemeAsEmptyDocument(const String&);
@@ -314,7 +315,7 @@
bool m_diskCacheIsDisabledForTesting;
#if PLATFORM(COCOA)
- mach_port_t m_compositingRenderServerPort;
+ WebCore::MachSendRight m_compositingRenderServerPort;
pid_t m_presenterApplicationPid;
dispatch_group_t m_clearResourceCachesDispatchGroup;
bool m_shouldForceScreenFontSubstitution;
Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (177592 => 177593)
--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm 2014-12-19 21:26:07 UTC (rev 177592)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm 2014-12-19 21:48:38 UTC (rev 177593)
@@ -148,7 +148,7 @@
}
#endif
-void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, IPC::MessageDecoder&)
+void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& parameters, IPC::MessageDecoder&)
{
#if ENABLE(SANDBOX_EXTENSIONS)
SandboxExtension::consumePermanently(parameters.uiProcessBundleResourcePathExtensionHandle);
@@ -187,7 +187,7 @@
}
#endif
- m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
+ m_compositingRenderServerPort = WTF::move(parameters.acceleratedCompositingPort);
m_presenterApplicationPid = parameters.presenterApplicationPid;
m_shouldForceScreenFontSubstitution = parameters.shouldForceScreenFontSubstitution;
Font::setDefaultTypesettingFeatures(parameters.shouldEnableKerningAndLigaturesByDefault ? Kerning | Ligatures : 0);