Title: [239032] trunk/Source/WebKitLegacy/mac
Revision
239032
Author
[email protected]
Date
2018-12-10 09:50:38 -0800 (Mon, 10 Dec 2018)

Log Message

[macOS] Use mach_port_mod_refs instead of mach_port_destroy
https://bugs.webkit.org/show_bug.cgi?id=192532
rdar://problem/45731047

Patch by Darin Adler <[email protected]> on 2018-12-10
Reviewed by Chris Dumez.

* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::hostForPlugin): Use mach_port_mod_refs.
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (239031 => 239032)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-12-10 17:17:26 UTC (rev 239031)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-12-10 17:50:38 UTC (rev 239032)
@@ -1,3 +1,16 @@
+2018-12-10  Darin Adler  <[email protected]>
+
+        [macOS] Use mach_port_mod_refs instead of mach_port_destroy
+        https://bugs.webkit.org/show_bug.cgi?id=192532
+        rdar://problem/45731047
+
+        Reviewed by Chris Dumez.
+
+        * Plugins/Hosted/NetscapePluginHostManager.mm:
+        (WebKit::NetscapePluginHostManager::hostForPlugin): Use mach_port_mod_refs.
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): Ditto.
+
 2018-12-05  Wenson Hsieh  <[email protected]>
 
         Turn WritingDirection into an enum class

Modified: trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm (239031 => 239032)


--- trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm	2018-12-10 17:17:26 UTC (rev 239031)
+++ trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm	2018-12-10 17:50:38 UTC (rev 239032)
@@ -85,7 +85,7 @@
     mach_port_t pluginHostPort = MACH_PORT_NULL;
     ProcessSerialNumber pluginHostPSN;
     if (!spawnPluginHost(pluginPath, pluginArchitecture, clientPort, pluginHostPort, pluginHostPSN)) {
-        mach_port_destroy(mach_task_self(), clientPort);
+        mach_port_mod_refs(mach_task_self(), clientPort, MACH_PORT_RIGHT_RECEIVE, -1);
         m_pluginHosts.remove(result.iterator);
         return nullptr;
     }

Modified: trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostProxy.mm (239031 => 239032)


--- trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostProxy.mm	2018-12-10 17:17:26 UTC (rev 239031)
+++ trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostProxy.mm	2018-12-10 17:50:38 UTC (rev 239032)
@@ -134,11 +134,10 @@
 {
     pluginProxyMap().remove(m_clientPort);
 
-    // Free the port set
     if (m_portSet) {
         mach_port_extract_member(mach_task_self(), m_clientPort, m_portSet);
         mach_port_extract_member(mach_task_self(), CFMachPortGetPort(m_deadNameNotificationPort.get()), m_portSet);
-        mach_port_destroy(mach_task_self(), m_portSet);
+        mach_port_mod_refs(mach_task_self(), m_portSet, MACH_PORT_RIGHT_PORT_SET, -1);
         m_portSet = MACH_PORT_NULL;
     }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to